Firefox – Change Firefox default encoding for text files

encodingfirefoxtextfilesunicode

Text files do not include character encoding information, so Firefox has no way of knowing which one is correct. Through the menu ViewText encoding I can select the appropriate encoding. I find myself doing this every time I open a text file, as it appears to be always set to Western by default, but my text files are always Unicode (UTF-8). Is there any way to set the default encoding to Unicode rather than Western?

Best Answer

If changing the default encoding for all offline files (not only text files) would also work for you, then there is now (I'm not sure since when, but it works in Firefox 59.0) an option to change the default encoding to UTF-8 in about:config: set the value of intl.charset.fallback.utf8_for_file to true.

Aside: it appears that one of the purposes of preventing the setting of the default encoding for online files is to avoid fingerprinting.

See also similar questions on stackoverflow (with the actual answer (used here)) and unix.stackexchange (with an interesting discussion of some of the rationale).

Related Question