How to replace special characters with html code characters automatically?

A colleague and I work on these html pages. They eventually end up as emails, but we have the cold fusion server to pre process them. One thing we are trying to do is eliminate problems caused by unencoded copyright, trademark and smart quote symbols.
How could I create an array of find / replace commands in the header so it processes the HTML with correct character codes.
I"m not cold fusion aware, so any kind of starter info would be great. Eventually I might add more replacements to the array.
As an example TM (font character) would process to ™ and a smart quote or apostrophe would process to a straight one. an en dash character would become –
Because we copy paste from places, this often happens and it seems like cold fusion could solve the problem quickly and repeatedly all at once.
thanks for any help
-smick

CF has a built in HTMLEditFormat function for handling <  &  > characters.  For handling trademark and smart quote characters you might try searching for a user defined function at http://cflib.org or writing a user defined function yourself that will handle the specific characters needed in your application.

Similar Messages

  • Email with HTML code

    I have a problem with generating HTML based email.
    BPEL code example:
    <copy>
    <from expression="'%lt;HTML%gt;%lt;BODY%gt;%lt;B%gt;Hello World! %lt;/B%gt;%lt;/BODY%gt;%lt;/HTML%gt;'"/>
    <to variable="mailRequestOne" part="payload" query="/mail:mailMessage/mail:content/mail:multiPart/mail:bodyPart[1]/mail:content"/>
    </copy>
    It would send email:
    %lt;HTML%gt;%lt;BODY%gt;%lt;B%gt;Hello World!%lt;/B%gt;%lt;/BODY%gt;%lt;/HTML%gt;
    Any idea how to send an email with HTML code?
    ps: replace % by &

    Not sure what you expect. Your URL is absolute and pointing to a local file resource. It's not a proper relative HTML link. Beyond that it's toatlly unclear how you actually plan to load your image and where they are hosted, so nobody can tell you anything. Either way, there is an obviously painful lack of understanding of even the most basic web techniques, so the best advise anyone would give you is to spend some time with a web search and actualyl learn some of that stuff...
    Mylenium

  • How to insert a shoutbox and a counter in a flash file with html code?

    How to insert a shoutbox and a counter in a flash file with
    html code?
    Code shout box
    <!-- BEGIN MYSHOUTBOX.COM CODE -->
    <iframe src="
    http://489676.myshoutbox.com/"
    width="152" height="300" frameborder="0"
    allowTransparency="true"></iframe>
    <!-- END MYSHOUTBOX.COM CODE-->
    Code compteur
    <script type="text/javascript" src="
    http://www.123compteur.com/counterskinable01.php?votre_id=268303"></script><noscript><a
    href="
    http://www.123compteur.com"
    target="_blank">compteur</a></noscript>

    thx =D

  • Inserting an image into Clearbox with html code

    Hi guys,
    I am using Clearbox to make pop up boxes so I can use text and images in it and I am editing them with html code.
    This is the code that I have (default for clearbox html)
    <div class="item"><a href="htmlcontent" rel="clearbox[gallery=Gallery,,width=400,,height=200,,html=&lt;br /&gt;&lt;strong&gt;&lt;font size=&quot;4&quot; color=&quot;#999&quot;&gt;BRC Food!&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;You can use most of html codes. For more information, please check the 'Professional usage' on www.clearbox.hu!&lt;/strong&gt;,,title=HTML content]"><img  src="images/brc_food_1.jpg" alt="html content" /></a></div>
    This code works fine, but I also want to add an image to it.
    <img src="images/brc_food.jpg" alt="BRC Food" width="500" height="334">
    Can anyone tell me how I would add the above together. Just inserting it into the code does not work, and I have also tried replacing the
    &lt; INSTEAD OF < / &gt; INSTEAD OF > / &quot; INSTEAD OF "
    Any help would be appreciated

    Whenever I deploy Fancybox on a page, I usually throw "the whole enchilada", to use a food analogy, in there:
    I link to every possible script from Fancybox just in case I'll need it.
    <script type="text/javascript" src="fancybox/lib/jquery-1.9.0.min.js"></script>
    <script type="text/javascript" src="fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
    <script type="text/javascript" src="fancybox/source/jquery.fancybox.js"></script>
    <link rel="stylesheet" type="text/css" href="fancybox/source/jquery.fancybox.css" media="screen">
    <link rel="stylesheet" type="text/css" href="fancybox/source/helpers/jquery.fancybox-buttons.css">
    <script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-buttons.js"></script>
    <link rel="stylesheet" type="text/css" href="fancybox/source/helpers/jquery.fancybox-thumbs.css">
    <script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-thumbs.js"></script>
    <script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-media.js"></script>
    <script type="text/javascript" src="fancybox/lib/fancybox_definitions.js"></script>
    That last one "fancybox_definitions" is simple a remote file I made from the inline styiling I found in thwe Fancybox demo page:
    It reads as follows:
    // JavaScript Document
    $(document).ready(function() {
    *  Simple image gallery. Uses default settings
    $('.fancybox').fancybox();
    *  Different effects
    // Change title type, overlay closing speed
    $(".fancybox-effects-a").fancybox({
    helpers: {
    title : {
    type : 'outside'
    overlay : {
    speedOut : 0
    // Disable opening and closing animations, change title type
    $(".fancybox-effects-b").fancybox({
    openEffect  : 'none',
    closeEffect     : 'none',
    helpers : {
    title : {
    type : 'over'
    // Set custom style, close if clicked, change title type and overlay color
    $(".fancybox-effects-c").fancybox({
    wrapCSS    : 'fancybox-custom',
    closeClick : true,
    openEffect : 'none',
    helpers : {
    title : {
    type : 'inside'
    overlay : {
    css : {
    'background' : 'rgba(85,164,194,0.85)'
    // Remove padding, set opening and closing animations, close if clicked and disable overlay
    $(".fancybox-effects-d").fancybox({
    padding: 0,
    openEffect : 'elastic',
    openSpeed  : 150,
    closeEffect : 'elastic',
    closeSpeed  : 150,
    closeClick : true,
    helpers : {
    overlay : null
    *  Button helper. Disable animations, hide close button, change title type and content
    $('.fancybox-buttons').fancybox({
    openEffect  : 'none',
    closeEffect : 'none',
    prevEffect : 'none',
    nextEffect : 'none',
    closeBtn  : false,
    helpers : {
    title : {
    type : 'inside'
    buttons     : {}
    afterLoad : function() {
    this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
    *  Thumbnail helper. Disable animations, hide close button, arrows and slide to next gallery item if clicked
    $('.fancybox-thumbs').fancybox({
    prevEffect : 'none',
    nextEffect : 'none',
    closeBtn  : false,
    arrows    : false,
    nextClick : true,
    helpers : {
    thumbs : {
    width  : 50,
    height : 50
    *  Media helper. Group items, disable animations, hide arrows, enable media and button helpers.
    $('.fancybox-media')
    .attr('rel', 'media-gallery')
    .fancybox({
    openEffect : 'none',
    closeEffect : 'none',
    prevEffect : 'none',
    nextEffect : 'none',
    arrows : false,
    helpers : {
    media : {},
    buttons : {}
    *  Open manually
    $("#fancybox-manual-a").click(function() {
    $.fancybox.open('1_b.jpg');
    $("#fancybox-manual-b").click(function() {
    $.fancybox.open({
    href : 'iframe.html',
    type : 'iframe',
    padding : 5
    $("#fancybox-manual-c").click(function() {
    $.fancybox.open([
    href : '1_b.jpg',
    title : 'My title'
    href : '2_b.jpg',
    title : '2nd title'
    href : '3_b.jpg'
    helpers : {
    thumbs : {
    width: 75,
    height: 50
    Copy that block of code and save it into a js file with the name "fancybox_definitions" in the fancybox/lib folder.
    Then add the other "calls" to Fancybox files to your header.  It should work from there.

  • Saving characters with ASCII codes (128 - 256) into txt file problem

    Hello,
    I am saving a query results into a text file (test.txt) with this procedure:
    BEGIN
    OWA_UTIL.mime_header ('application/octet', FALSE);
    HTP.p ('Content-Disposition: attachment; filename="TEST.TXT"');
    OWA_UTIL.http_header_close;
    for rec in (select sample_text from tmp)
    loop
    htp.prn ( chr(230) || rec.sample_text || utl_tcp.crlf);
    end loop;
    -- Send an error code so that the rest of the HTML does not render
    HTMLDB_APPLICATION.g_unrecoverable_error := TRUE;
    END;
    How can I save characters with ascii codes from 128 - 256 into the output file? If I use chr() function, characters are missing in the output file.
    Platform: Apex 4.2 on apex.oracle.com

    Hi 1010398,
    Some thoughts:
    I assume you've counted the characters in the output and/or used a "hex" text editor so you KNOW these characters are not being written. Are they not written at all, or are blanks being substituted or are NULLs being substituted?
    I couldn't find much documentation on htp.prn. Though, one place I found
    htp.prn (cbuf IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL);Do you suppose it's affected by the character set used?
    Howard

  • How to send a mail with HTML body from Oracle

    Hi Team,
    Can somebody guide me how to send a mail with HTML body from oracle.
    Here is the piece of code i am trying to send a mail.
    procedure SEND_MAIL is
    cursor c_1 is select * from table_name;
    l_mail_id varchar2(40);
    -- ls_mailhost VARCHAR2(64) := Mailhost;
    ls_from VARCHAR2(64) := ‘[email protected]
    ls_subject VARCHAR2(200);
    ls_to VARCHAR2(64);
    l_mail_conn UTL_SMTP.connection;
    ls_left_menu_name VARCHAR2(64);
    ll_emp_num number(8);
    begin
    for i in c_1 loop
    begin
    l_mail_conn := UTL_SMTP.OPEN_CONNECTION('IP');
    UTL_SMTP.HELO(l_mail_conn, 'IP');
    UTL_SMTP.MAIL(l_mail_conn, LS_FROM);
    UTL_SMTP.RCPT(L_mail_conn, LS_TO);
    UTL_SMTP.DATA(l_mail_conn,'From: ' ||ls_from || utl_tcp.crlf ||
    'To: ' ||ls_to || utl_tcp.crlf ||
    'Subject: ' ||ls_subject|| utl_tcp.crlf);
    UTL_SMTP.QUIT(l_mail_conn);
    exception
    when no_data_found then
    null;
    when others then
    RAISE_APPLICATION_ERROR(-20000, 'Failed to send mail due to the following error: ' || sqlerrm);
    end;
    end loop;
    end;
    Thnx

    Hi Nicolas!
    Have you tried to set "Output Format" for "RAW Text" to HTM in SCOT.
    If HTM is missing in your dropdown-list, you could check out table SXCONVERT2. Copy the line with category T/format TXT, and change the format from TXT to HTM. The existing function
    SX_OBJECT_CONVERT__T.TXT does not need to be changed. Now you should be able to choose HTM in SCOT. You will probably need som HTML-tags in your text to make it look good.
    Hope this helps!
    Regards
    Geir

  • How to replace a movieclip with another movieclip

    How to replace a movieclip with another movieclip
    Hi,
    I am having a swf called tchild.swf... in this i got a
    movclip 'child1'. i am loading this tchild.swf into another swf
    tparent.swf within 'mcloader' movie clip.. i got another movclip
    called 'picture1'
    i am loading tchild.swf into mcloader movclip.. and i want to
    load 'child1' moviclip into picture1..
    how to replace a picture1 movieclip with child1 mc..
    PS: i dont want to load picture1 from library.. its on the
    stage.

    AWT or Swing?

  • How to assign function module with process code in IDOC ?

    how to assign function module with process code in IDOC ? and what code i have to write in that function module for custom IDOC ?
    helpful answer will be rewarded?

    Hi,
    First goto transaction we42 -->editing mode --> new entries -->give name of your process code and description --> processing with alv service and function module -->then press enter -->after that enter the name of the function module you want to associate from the drop down and save it.
    Thats the way to assign function module with process code.
    In that process code we will have the Function modules and Bapi's which will take the data which we are sending through IDOC and then process it.
    for example: i am triggering the IDOC for every purchase order created then this process code in the receiver system will take the data which i have enetered in the sender system to create the purchase order and process it and creates the same purchase order in the receiver's system.
    Reward if helpful.
    with regards,
    Syed

  • How to replace key value with character

    Hi Experts
    Can any one tell me, how to replace key value with character, whether it is possible are not. My present report is displaying below format.
    country--city-area-flatnocountry--City-Flatno
    Customer--USACOst1111---UK--HD20--
    C100--11---11--
    C200--11---1--
    For the above example format i am able to display. But now i want to replace 1 with character value for example. For C100
    country is USA at presnt 1 but it should replace with USA.
    You find required format below.
    country--city-area-flatnocountry--City-Flatno
    Customer--USACOst1111---UK--HD20--
    C100--USACOst1111--
    C200--UK--HD20--
    thanks .
    Regards,
    Vishal.

    Hi Markus,
    Thanks for reply,
    Actually i dont have attribute for the customer, the data is maintained in ods, in the form, customer name one info-object and customer value one more info-object this value got text. This value stored in the ods as below
    costomer number  customer value
    C100--USA
    -C100CO
    C100--11-
    C200----
    UK
    C200----
    20
    Please let me know any clarification you need.
    Thanks and Regards,
    Vishal.

  • How to restore iPhone 3gs with error code 1015 ??

    How to restore iPhone 3gs with error code 1015 ??

    The only advice we can give is to try and put it into DFU mode and restore. If that doesn't fix it, buy a new phone.
    There is a reason that Jailbreaking isn't supported. You have just been kicked in the donkey by it.

  • Replacing non-ASCII characters with HTML charcter references

    Hi All,
    In Oracle 10g or greater is there a built-in function that will convert a string with non-ASCII characters like this
    a b č 뮼
    into an ASCII string with HTML character references like this?
    a b & # x 0 1 0 D ; & # x B B B C ;
    (note I had to include spaces between each character in the sample code for message to prevent the forum software from converting my text)
    I tried using
    utl_i18n.escape_reference( val, 'us7ascii' )
    but for some reason it returns
    a b c & # x B B B C ;
    Note how it converted the Western European character "č" to its unaccented counterpart "c", not "& # x 0 1 0 D ;" (is this a bug?).
    I also tried a custom solution using regexp_replace and asciistr (which I can't include here because the forum software chokes on it) but it only returns the correct result for values <=4000 characters long. Unfortunately asciistr doesn't appear to accept CLOB values larger than 4000 characters. It returns an error message like
    (ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 30251, maximum: 4000) ).
    I'm looking for a solution that works on CLOB data of any size.
    Thanks in advance for any insight you can provide.
    Joe Fuda

    So with that (UTF8) in mind, let's take another look.....
    As shown below, I used a AL32UTF8 database.
    Note: I did not use a unicode capable tool for querying. So I set console mode code page to 1250 just to have č displayed properly (instead of posing as an è).
    Also, as a result of using windows-1250 for client character set, in the val column and in the second select's ncr column (iso8859-1), è (00e8) has been replaced with e through character set conversion going from server back to client.
    Running the same code on a database with a db character set such as we8mswin1252, that doesn't define the č (latin small c with caron) character, would yield results with a c in the ncr column.
    C:\>chcp 1250
    Aktuell teckentabell: 1250
    C:\>set nls_lang=.ee8mswin1250
    C:\>sqlplus test/test
    SQL*Plus: Release 11.1.0.6.0 - Production on Fri May 23 21:25:29 2008
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the OLAP option
    SQL> select * from nls_database_parameters where parameter like '%CHARACTERSET';
    PARAMETER              VALUE
    NLS_CHARACTERSET       AL32UTF8
    NLS_NCHAR_CHARACTERSET AL16UTF16
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'us7ascii') NCR from dual;
    VAL  NCR
    č e  c e
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'we8iso8859p1') NCR from dual;
    VAL  NCR
    č e  &# x10d; e     <- "è"
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'ee8iso8859p2') NCR from dual;
    VAL  NCR
    č e  č &# xe8;
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'cl8iso8859p5') NCR from dual;
    VAL  NCR
    č e  &# x10d; &# xe8;In the US7ASCII case, where it should be possible for all non-ascii characters to be escaped, it seems as if the actual escape step is skipped over.
    Hope this helps to understand whether utl_i8n is usable or not in your case.
    Message was edited by:
    orafad
    Fixed replaced character references :)

  • How to replace special characters in string.

    Hello,
    I want to replace special characters such as , or ; with any other character or " ".I find out there is no such function is java for this.There is only replace() but it accepts only chars.If anybody know how to do this?.
    Thanks,

    Hello,
    I want to replace special characters such as , or ;
    with any other character or " ".I find out there is no
    such function is java for this.There is only replace()
    but it accepts only chars.If anybody know how to do
    this?.
    Thanks,Can't you just do the following?
    public class Test
         public static void main(String[] args)
         String testString = "Hi, there?";
         System.out.println(testString.replace(',',' '));
    }

  • Replacing carriage return with HTML " br/ "

    All,
    I have a textarea in an HTML page that receives text input from the user. The text is stored in a varchar2 column and then rendered back into the HTML page as static text.
    I'd like to make it easy for the end user and not force them to enter "<br/>" characters (exactly how this forum works) for new lines and paragraphs.
    On the insert trigger for the note text, I'm thinking of using:
    :new.note_text := replace(:old.note_text, chr(0), '<br/>');1) Will this work?
    2) Is this the best way to do this?
    Thanks.

    Yes, I did mean chr(10). So I set up my trigger to include the replace() function on "note_text":
    create or replace trigger "NOTE_INSERT_TGR"
    BEFORE
    insert on "NOTE"
    for each row
    declare
      next_val number(20);
    begin
      select note_id_seq.nextval
        into next_val
        from dual;
      :new.note_id       := next_val;
      :new.note_text     := replace(:old.note_text, chr(10), '<br/>');
      :new.date_created  := sysdate;
      :new.last_modified := sysdate;
    end;
    /but nothing is being inserted into the "note_text" field. In my PL/SQL code block, I'm using the following logic for the insert statement:
      if (:P2_NOTE_TEXT is not null) then
        insert into note(application_id, note_text)
          values(:P2_APPLICATION_ID, :P2_NOTE_TEXT);
      end if;and have even tried placing the replace() function here with no results at all (probably related to some internal processing with HTMLDB).
    When I query my note table, I can verify (null) is being inserted.
    select note_id, note_text
    from note
    returns
    NOTE_ID     NOTE_TEXT
    56     (null)Any ideas why I'm losing the note text?
    Thanks.

  • How to replace double quotes with a single quote in a string ?

    Hi All:
    Can some one tell me how to replace double Quote (") in a string with a single quote (') ? I tried to use REPLACE function, but I couldn;t get it worked.
    My example is SELECT REPLACE('STN. "A"', '"', ''') FROM Dual --This one throws an error
    Thanks,
    Dima.

    Whether it is maybe not the more comfortable way, I like the quoting capabitlity from 10g :
    SQL> SELECT REPLACE('STN. "A"', '"', q'(')') FROM Dual;
    REPLACE(
    STN. 'A'{code}
    Nicoals.                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to replace the '&' character with '&' in xi

    Hi,
    i need to replace the '&' character with ' &amp;'.but i f i am converting it is displaying as '&' because internally '&amp;' = '&'.
    beacuse of this it is not converting.
    is there any possiblity to change the  standard conversion in xi.

    Graphical mapping does not support special character like & , <,> to be mapped.
    You can encode & as and in UTF-8 only.
    if you want the special character to be used, Opt XSLT mapping with ISO-8859-1 encoding
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="ISO-8859-1"/>
    <xsl:template match="/">
    <xsl:copy-of select="*" />
    </xsl:template>
    </xsl:stylesheet>
    How to Work with Character Encodings in Process Integration (NW7.0)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42

Maybe you are looking for

  • BPC 10.0 NW - How do I make Business Rules run one Period at a time

    I was wondering if anyone has a way to make business rules run one period at a time before moving on to the next to the next time period (i.e. January 2014 calc prior to moving on to February 2014).  In past SQL this could be achieved with a piece of

  • Mail in Time Machine

    Is there a way to search e-mail in Time Machine? I use Mail and when I start TM to look the search bar in Mail becomes ghosted leaving me with the one solution: look through every folder in every back up manually. Anyone have a suggestion?

  • Generic SQL Injection

    Hi, regarding IDS signature 5930. This appears to be an old signature re-released with the recent asproxy vulnerabilities in mind. We have seen this fire with subsig 5 (asprox) and subsig 4 which detects " AND 1=1" in HTTP arguments. However when we

  • Relationship btn FPP1 and BUA1

    Hi, I want to create a BP using FPP1 and another using BUA1 tcode and I want to make a relationship btn these 2 using FPP2. Iam using BAPI_BUPA_CREATE_FROM_DATA for 1st scenario. Pls suggest me for the 2nd one and about the relationship. Thanks & Reg

  • Font for Print out and Print Preview

    Hi all, I am working in SAP R/3 4.6C and using SmartForm.I have a trouble : I uploaded  Arial Font into System Font and Printer Font and i want to use this font for print out and print preview.But this font is only applied for print out and the print