Hi Jeremy,

 

I had a similar problem with my apps when clients would use Word and past into my rich text editor. I created some JavaScript code sweeping functions on the past event to sweep unwanted code. One of the functions deals with special characters. I don’t know if this will hep.

 

function replaceCharacters(html) {

 

            // Special characters and their HTML equivelent

            var set = [

                        ["€","‘","’","’","“","”","–","—","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�","�"],

                        ["€","‘","’","’","“","”","–","—","¡","¢","£","£","¤","¥","¦","§","¨","©","ª","«","¬","�","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ü","ý","þ","ÿ"]

            ];

 

            // Replace each instance of one of the above special characters with it's HTML equivelent

            if (html) {

                        for(var j = 0; j < set[0].length; j++){

                                    html = html.replace(eval("/"+set[0][j]+"/g"),set[1][j]);

                        }

            }

 

            // Return the HTML or an empty string if no HTML was supplied

            return html || "";

}

 

 

-----Original Message-----
From: Jeremy Oudit [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 15, 2002 10:32 AM
To: [EMAIL PROTECTED]
Subject: [CFTALKTor] Special characters problem.

 

Hi Guys,

 

I keep running into a problem that has driven me mad for a while now. I think it has to do with the formatting of text within a text box.

I can't get special characters to display consistently. for example. If I cut and paste text out of MSWord it will change all special characters into ?'s when cold fusion pulls this in to a web page. So now whenever I use an admin module I always enter special characters as code e.g. the copyright symbol as &copy;
 

There are a few problems with this solution though. The major one is that when I edit a given section, all of the code for special characters get lost and they instead are displayed as the actual character. As a result if I hit submit all of those characters get converted to ?'s. To deal with that, I have to cut and paste all of my content code in to a code editor, then find and replace all of the special characters with code again.   @#@&&@*!!!!

Obviously, this is not an good solution for clients who only only know how to cut and paste using MSWord.

Is there some sort of text formatting thing that I'm missing in SQL or in the form field that will fix this?

 

Jeremy

Reply via email to