Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

For some websites I noticed the Firefox's 'View/character encoding' menu is disabled, why?

Is it possible to enable it?

share|improve this question
    
An example for one such site is haszon.hu . –  Calmarius Jul 16 at 11:42
    
Possibly related to bug 832910, which requests that the encoding menu be disabled on certain sites to prevent exploits (that one is Android-specific and unresolved; I'm hunting for the desktop equivalent). –  Bob Jul 16 at 15:25

2 Answers 2

It's due to the fix for Bug 234628, Disable View>Character Coding menu when it won't have effect / is unnecessary (e.g. XML).

Specifically, if you look at comment #63:

As for the case where there is a UTF-8 BOM, it makes sense to let the BOM take precedence over the menu

The BOM is used to identify the order of bytes in a Unicode-encoded document.

The reasons given can be summarised as:

  • Gecko (Firefox's rendering engine) does not support any other encoding that would render a BOM as a valid HTML start (<html or <!DOCTYPE etc.).

  • Other major browsers (IE6+, WebKit-based [Chrome, etc.]) do the same thing. For example, if you try to change the encoding on Chrome it just resets back to UTF-8.

  • Doing otherwise could potentially mess up form input.


The example page you provided starts with the three UTF-8 BOM bytes. You can see this if you save the page and open the HTML file in a hex editor. The BOM positively identifies it as a UTF-8 document, and opening it in any other encoding would not yield a correct HTML page.

Screenshot of hex editor showing BOM

You can see the 0xEF 0xBB 0xBF BOM on the left, as described on Wikipedia. On the right, it shows what it looks like when rendered as ANSI/CP1252.

If you really want to, you can save the file, strip off the offending BOM and open the file. Or you can set up a proxy (Fiddler2 is good for this) that will intercept and modify the files before they get to your browser. However, these aren't really good solutions, and are likely to just create further problems. The best thing to do, if you have encoding issues, is to contact the website maintainer. We should all be moving to Unicode where possible anyway, not using the older and more limited encoding standards.

share|improve this answer

It's probably a bug. Chromium had a similar issue years ago.

share|improve this answer
1  
It's not a bug. It was completely intentional. Note that according to this comment, the menu has no effect in Chrome on similar pages (and I just tested, on current Chrome it resets to UTF-8 if you try to change it). –  Bob Jul 16 at 15:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.