Simone Bonelli
Simone Bonelli

Reputation: 421

Set a default character-encoding to UTF-8 in Mozilla Firefox

How can I set the default Mozilla Firefox character-encoding to UTF-8, so if the HTML page lacks the meta tag to set charset, the character encoding is interpreted as UTF-8?

Upvotes: 10

Views: 13947

Answers (2)

hsivonen
hsivonen

Reputation: 8026

There is no browser-side setting for this. If there was, people authoring content would make content that looks right for them but would be broken for other readers.

If the HTML file is loaded from a file: URL and the content is UTF-8, Firefox autodetects it at the cost of breaking incremental rendering, but incremental rendering isn't important for file: URLs, since the content is assumed to be finite and available quickly.

For online content, the setting is whatever configuration makes your server send Content-Type: text/html; charset=UTF-8

Longer explanation

Upvotes: 3

trank
trank

Reputation: 1012

In Firefox, open a new tab, go to about:config and press the confirm button.

Search for the key "intl.charset.fallback.utf8_for_file" and double-click to set its value to true.

This solution works with offline HTML files that don't contain the charset meta tag.

Upvotes: 9

Related Questions