Where Firefox's text encoding menus are
I recently read Text Encoding Menu in 2021 (via), on Firefox's menu (or menus) for controlling what text encoding a web page or other resource is interpreted in. The menu that Henri Sivonen described puzzled me, because it wasn't the text encoding menu that I'm familiar with and the text listed didn't initially match mine.
Firefox's 'Text Encoding' menu (or menus) lets you select or in some cases alter the text encoding of documents that the browser is displaying. In the past this was an important option; content was actually in all sorts of character sets, it wasn't necessarily served with character set information (or with the right information), browsers didn't necessarily do a good job of guessing or detecting character sets, and so on. These days a lot of content is in UTF-8 or is served with the correct character set information, and browsers have gotten better at detecting character sets on the remaining, so it is much less frequently needed or used (as the article covers).
(For the latter, see Henri Sivonen's chardetng: A More Compact Character Encoding Detector for the Legacy Web, which is honestly fascinating.)
Firefox has two versions of this menu. The first version is the conventional one, accessed through the regular menus at View → Text Encoding. The second version is accessed through an item icon that you can add after the URL bar, in the URL bar overflow menu, or with some careful dragging, add to the right side of the tab bar. This customization environment is accessed by right-clicking in either the tab bar or in the url bar outside the actual URL area and picking 'Customize'.
However, both versions are almost always going to be disabled, because changing text encoding is disabled if the server provided character set information and that's almost always the case these days. The View → Text Encoding menu is disabled by greying out the entire menu option. The Text Encoding icon version is disabled by not letting you change whatever the encoding is; you can bring up the menu but all of the other options are greyed out.
(If you are looking at a local file on Linux, the 'server' seems to be your locale setting if the file has no other information, such as being a plain text file or a HTML file with no character set declaration. This makes a certain amount of sense.)
The exact version of the Text Encoding menu that Henri Sivonen describes is only in Firefox Nightly right now, not in Firefox 84 (and it needs a recent version of Nightly). Firefox 84 lacks at least the 'Automatic' entry that Sivonen listed and there may be differences in behavior (I haven't cross-compared the menus or the behavior).
(This is one of those entries that I write because I got confused and dug into this. The perpetually greyed out View → Text Encoding menu was especially puzzling, since I managed to not notice that my Text Encoding icon was equally non-useful even though it would display a menu.)
|
|