views:

184

answers:

2

Dear gurus

I have one page encoded with utf-8 that is login another page also encoded with utf-8. In order to load one page into a div in the other, I use them load() method of jQuery 1.4.2. Everything works fine in Chrome, but in FireFox all the non-american characters are shown as a strange mark. If I use FireBug to inspect the loaded div, I can see the the inner page (the one thar was loaded) has the encoding charset=iso-8859-1.

What I am missing?

TIA

A: 

Check the HTTP charset of the inner page: Its web server should serve it as

Content-Type: text/html; charset=utf-8 

Or it might be you have to set it on the script you're requesting through Ajax.

chryss
I checked the inner page and it´s encoded as utf-8. How do I set it the script?
Gambit
How did you check the page? Is it public, so can you provide URLs?
chryss
This is the top of the page that is being loaded:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><meta content="pt-br" http-equiv="Content-Language" /><link type="text/css" href="../../css/padrao.css" rel="stylesheet"/><title>Conhecendo o Fênix</title></head><body> ...
Gambit
This doesn't tell you the HTTP response header. Do you load it from a URL? if yes, run curl --head http://your.url.whatever/etc/pp
chryss
A: 

Hello.

I accidently fixed the problem. The fact is that all the html files involved in the problem were encoded as UTF-8, all right. However, the mail html file was linked to a CSS file that was encoded differently. For some reason, the load() method in jQuery was being influenced by that encoding in FireFox.

I hope this can help other people in similar circunstances.

Bye!

Gambit