Link to home
Start Free TrialLog in
Avatar of arvanhalleorg
arvanhalleorg

asked on

french accents?

Hi,

I have the charset for the iso-8859-1 to show the accents correctly on a page, however when I run it through the ajax code to show up on the new asp page, it gives me a square instead of a character with an accent. Is there a way to get javascript to recognize the accents and send them through correctly?

Audrey-Rose
Avatar of Basilisci
Basilisci

I believe the AJAX code assumes the encoding to be UTF-8, as that's the standard encoding in XML (even if the page encoding is different). So when an ISO-8859-1 XML file is parsed as UTF-8, you get messed up strings.

I'd recommend saving the files you fetch using ajax, with UTF-8 encoding.

You could also check that the server does not send wrong encoding information in the HTTP headers.
Avatar of arvanhalleorg

ASKER

uhm. where does this xml come from? my iso-8859-1 is my asp file. That's showing the correct information. My problem is when I take for example a city like Québec and send it through to a function then showing it on the asp page.
also, the index that holds the result div, shows the accents correctly prior to sending through.
hmm actually its not javascript eating it up. i guess its the xml like you said. i get this weird c00ce514 error so i've no idea what the problem is anymore. i havent called the information any differently than my other pages :/
got it. it wasn't the xml at all. it's the meta tag <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

the meta tag wasnt taking the information correctly for some reason so i put this in:
response.contenttype = "text/html"
response.charset = "iso-8859-1"

and it works now.
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial