Search code examples
htmlfirefoxutf-8opera

Use umlauts in UTF-8 coded HTML-files with firefox


<h1>Wörterbuch</h1>

This is a very simple (generated by Zotero) html file and it is UTF-8 coded. But firefox is not able to handle it correct.

When viewing the source of the opened html file in firefox it looks like that.

<h1>Wörterbuch</h1>

My last touch of HTML is from the beginning of the 90's. This file is UTF-8 so firefox should know itself how to handle the ö their. But it doesn't so I need something in the header, right? What information does firefox need here?

This work well with Opera.


Solution

    1. Make sure your HTTP server is sending the correct HTTP header to identify the encoding of the document:

      Content-Type: text/html; charset=utf-8
      
    2. As a fallback, add the <meta> tag to the document's <head>:

      <meta charset="utf-8">