I don't see a way to change the default encoding in Firefox 54.0 from about:config
, but you can manually change it every time you view the page, from the view menu (not ideal, I know). I don't see any extensions that let you do it, either (although I'm sure someone could make one). It might be a gargantuan task, but you could always try to edit the Firefox source code to allow for this, and then compile it.
You might be interested in making it so a text editor of your choice (one that supports Unicode) will open the page source (or the txt file) instead of Firefox doing it (you can use control+u to open a txt file that is displaying in the current tab, or if it's not a txt file it'll open the webpage's HTML source code, in your favorite text editor). To do that,
- Open
about:config
in your URL bar.
- Search for
view_source.editor.external
(change it to true) and view_source.editor.path
(change it to the path of your text editor; make sure it's the full path).
- Restart your browser.
Then it'll launch a temporary file with the text of the page source in your text editor (which for a text file is the actual text file). I tested it and it works.
The glaring problem with this is it won't let you click to open scripts referenced in the source code if you're viewing HTML source code (if you have a habit of clicking links to script files).
It appears that another version of Firefox had the ability to set the default encoding once upon a time, but that doesn't exist in 54.0 on Xubuntu.
I guess my first question is why are you using a browser to open plain text files? Or if a browser is needed, why not add a encoding header? Beyond that, what version (locale) of Firefox do you have installed? If I recall en-US version defaults to Unicode but some European country versions default to Western. – user3169 – 2017-06-02T05:43:59.820
@user3169 I use Firefox to open text files on the local filesystem for printing, because I find that I have easier control over print output than when printing with (for example) a2ps or vi. My Firefox is in English, it might be en-uk though, not sure — how can I tell? Not sure what you mean by adding an encoding header to a plain text file? – gerrit – 2017-06-02T13:39:52.247
What is your OS? In Windows 7, you can see it in Program Files\Mozilla Firefox\install.log. Or you can (after backing up your profiles folder to be safe) uninstall the current installation and install with the installer you want (https://ftp.mozilla.org/pub/firefox/releases/). For FF questions you should include FF version and your OS in your question.
– user3169 – 2017-06-02T22:52:59.427Sometimes in a web page html source you will see something like <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> in the header. If you add such at the top of your text file, FF might select it for you. I am not an html expert but I think you get the idea. – user3169 – 2017-06-02T22:57:35.953
Possible duplicate here: https://superuser.com/questions/1062409/how-to-set-the-default-encoding-to-unicode?rq=1
– Brōtsyorfuzthrāx – 2017-09-05T22:58:33.493