How do I set the default encoding in Firefox/Iceweasel to Unicode (instead of Western)?

I'm particularly interested in the default encoding for *.txt files. Firefox/Iceweasel seems to always choose Western as the encoding for such files. I know that I can change the encoding for a particular page through View > Character Encoding, but it gets tiresome after a while.

  • Are you using a localized version of Firefox/Iceweasel, rather than 'English (US)'?
    – user3169
    Apr 7, 2016 at 6:04
  • @user3169: I don't recall performing any special configuration to that effect. How could I find out the answer to your question?
    – kjo
    Apr 7, 2016 at 7:35
  • 1
    I can't say for iceweasel, since I don't know how it is distributed, but for Firefox the installation software has localized versions, as shown on this page: Download Firefox in your language. Your default might depend on you locale or OS. If you don't know the locale for your installation, enter "about:healthreport" in the URL bar, click on "Raw Data", then click on one of the items on the right. Then search for locale and you will see a line like "locale": "en-US".
    – user3169
    Apr 7, 2016 at 17:08
  • See my answer to this question (which is a possible duplicate of yours): superuser.com/questions/1215064/… Sep 6, 2017 at 2:17

2 Answers 2


In about:config, set intl.charset.fallback.utf8_for_file to true.

However, this only works for local files (file:/// URLs).

(shamelessly copied from this answer)


You cannot configure this. If the encoding was a function of user-side configuration, people would create content dependent on their own settings, and then the content would not show up correctly for other readers.

For file: URLs, Firefox autodetects UTF-8 these days. (The older answer was correct when it was posted, though.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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