Open Bug 812542 Opened 12 years ago Updated 2 years ago

Charset detected as Western-8859-1 in a frame with meta charset="UTF-8"

Categories

(Core :: DOM: HTML Parser, defect)

16 Branch
x86
Windows XP
defect

Tracking

()

People

(Reporter: rvof, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0
Build ID: 20121024073032

Steps to reproduce:

Using Firefox
http://ht.hypertech.com.br/doutorja

Also tested with Opera, IE and Chrome





Actual results:

The text appears with wrong characters on Firefox

With Opera, IE and Chrome and others everithing is OK
A piece of thext
saúde. É assim: (on firefox)

With other brosers:
saúde. É assim:




Expected results:

Normal characters
The charset is only detected as Western-8859-1 if it's loaded as part of a frameset:
http://ht.hypertech.com.br/doutorja

It's correctly detected as UTF-8 if you load only the frame URL:
http://ht.hypertech.com.br/doutorja/aplic/doutorja.dll/EXEC/0/1lfde9f1a9h3gj1f483xr1kokfvu

There is a charset header in the frame (<meta charset="utf-8">) but it's below of some JS and that could be behind the 1024 byte boundary. 
There is no charset in the http header.

Reporter: Is that your page ?
Status: UNCONFIRMED → NEW
Component: Untriaged → HTML: Parser
Ever confirmed: true
Keywords: embed
Product: Firefox → Core
Summary: Erro rendering text brazilian port → Charset detected as Western-8859-1 in a frame with meta charset="UTF-8"
(In reply to Matthias Versen (Matti) from comment #1)
> The charset is only detected as Western-8859-1 if it's loaded as part of a
> frameset:
> http://ht.hypertech.com.br/doutorja
> 
> It's correctly detected as UTF-8 if you load only the frame URL:
> http://ht.hypertech.com.br/doutorja/aplic/doutorja.dll/EXEC/0/
> 1lfde9f1a9h3gj1f483xr1kokfvu
> 
> There is a charset header in the frame (<meta charset="utf-8">) but it's
> below of some JS and that could be behind the 1024 byte boundary. 

It indeed is beyond the 1024-byte boundary.

In this case, the browser is supposed to reload the page when the late meta is seen. Maybe the reloading doesn't work when framed. Alternatively, the charset source is set too high in nsHTMLDocument. Need to investigate more.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.