Log in

View Full Version : Resolved special characters



ggalan
08-25-2011, 08:26 PM
i am using javascript to read from XML to automatically populate a email subject and body. i have a special character in the xml - ö
<![CDATAörn Borg]]> (the special character gets converted here)
but the body of the email keeps coming out like this

Björn Borg
but if i copy/paste this ö into outlook its fine

using outlook as my email client
any suggestions on how to fix this?

djr33
08-25-2011, 08:30 PM
You'll need to match character encodings. You could try a few and see if you get it right or you could research what Outlook uses-- probably email in general.

Copying and pasting is irrelevant because that intermediate step doesn't use an encoding-- when pasting, the encoding of the document is automatically applied to whatever contents you have on the clipboard.

ggalan
08-25-2011, 08:43 PM
You'll need to match character encodings.
how do i do this?


OH, like unicode?

ggalan
08-25-2011, 08:45 PM
it seems like javascript picks up the special character code


var1=var1.replace(/&#246;/g,"ö");


can i do something like this? then what would i replace "ö" with?

ggalan
08-25-2011, 08:49 PM
Unicode!!