Search code examples
htmlcharacter-encodingfontsmeta-tags

meta charset windows-1252 vs UTF-8


My HTML pages use <meta charset="windows-1252">.

  1. Is changing to UTF-8 recommended and why?
  2. I checked some of my pages with UTF-8 and got question marks with some math symbols. E.G: x should be changed to × in order to show correctly. I tried the CpConverter but it did not convert well all the symbols.

Is there a better way to convert many files?


Solution

    1. UTF-8 is generally approved standard, which works everywhere. Windows-any encoding is Windows-specific and not guaranteed to work on any machine. Also, take a look here and here
    2. If you want to change the encoding of a file, you can do it in many ways. You can look for encoding type in your text editor/IDE or use the following command (not tested, it should work though):

    iconv -f WINDOWS-1252 -t UTF-8 filename.txt