Use UTF-8. Always. And nothing else.
It is true that other encodings still are used and understood, but there is no real advantage with any of them.
The "problems" Sitepoint lists for UTF-8 are:
- Not all editors or publishing tools support it.
- Some browsers don't understand the BOM, and will output it as text. Some editors won't allow us to omit the BOM.
- Some ancient browsers don't support UTF-8.
The second and third points are about browser limitations. Even if you manage to find a browser that is old enough not to be able to handle a BOM, it is just a blank line at the beginning of the file that may be wrong. However, modern browsers handle this well.
One could add a fourth point: the size of text files goes up for non-Latin alphabets, if you use UTF-8 compared to native encodings. However, so much of most modern HTML pages is javascript, tags and CSS and then images and media that the size of the actual text in 99.99% of all cases is insignificant.
Today there is no good reason for anyone to use anything but UTF-8.
No comments:
Post a Comment