We help IT Professionals succeed at work.

french accents?

arvanhalleorg
on
2,319 Views
Last Modified: 2008-01-09
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
Comment
Watch Question

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.

Author

Commented:
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.

Author

Commented:
also, the index that holds the result div, shows the accents correctly prior to sending through.

Author

Commented:
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 :/

Author

Commented:
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.
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.