Encoding html in ANSI vs UTF-8 w/o BOM

Lukáš Kozák picture Lukáš Kozák · Aug 24, 2013 · Viewed 14.4k times · Source

What's the difference between writing a e.g. php or html document in Ansi and UTF-8 without BOM and then uploading them on a webserver? Both document has meta UTF-8 in .

If someone writes simply with notepad, they have to choose Ansi, because notepad doesn't offer UTF-8 without Byde-Order-Mark

Answer

Antti Haapala picture Antti Haapala · Aug 24, 2013

The difference is that if you write your file in some 8-bit codepage and then forget to convert it to UTF-8, people might see your web page broken, because you set the charset is set to UTF-8 in meta; and to apply that bug fix in hurry, you cannot access the file in place using SFTP or WinSCP, because you'd have to convert into 8-bit codepage first again.

Furthermore UTF-8 is Unicode, and the full range of characters is supported, while in "ANSI" codepages then no. Not all Unicode documents can be converted back to "ANSI" codepages, and thus you could not edit them this way.

No sane person uses Windows Notepad for serious coding because its lack of functionality, syntax coloring, line ending formats and because of its awful support for character sets.