Search code examples
htmlencodingmeta

Difference between meta charset="utf-8" and Notepad++ utf-8 encoding?


Do I need to do both of them, only set the notepad++ encoding or only do it in the meta tag?


Solution

  • If you save as “UTF-8” (and not as “UTF-8 without BOM”) in Notepad++, then the meta tag is not needed, since browsers and search engines will infer the encoding from the BOM. This is what actually happens, and it is being defined formally in clause 8.2.2.1 Determining the character encoding in HTML5.

    Writing a meta tag does not change the actual encoding. If present, it should match the encoding, of course.