|
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----- 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. 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. @#@&&@*!!!! Jeremy |
- [CFTALKTor] Special characters problem. Jeremy Oudit
- [CFTALKTor] {Excel} Create Excel chart without inst... Mike Lau
- RE: [CFTALKTor] Special characters problem. Shane Von Svoboda
- RE: [CFTALKTor] Special characters problem. Lipp, Gord
