Many programs will supply one or more of the following as file encoding formats: UTF-8, UTF-16, UTF-32 and simply Unicode. How do I know what Unicode Transformation Format Unicode is referring to? I'm assuming it correlates to to one of the 8/16/32 formats but I have not been able to find that on the Unicode website.
Unicode is a standard that defines a list of abstract characters, rendering rules, code points, composition rules, and encoding systems. For example:
- the small greek epsilon is the character U+03B5
- the small c with a cedilla is the character U+00E7, but also the the small C U+0063 combined with the cedilla U+0327
UTF-8, UTF-16 and UTF32 are encoding formats for unicode characters on 8,16, or 32 bit integers. It should be added that when looking at the byte streams (e.g. files), UTF-16 and UTF-32 have both a big endian (BE) and a little endian (LE) variant.
So speaking of unicode encoding is misleading: there is not a single one. But there are common usage of this term:
- on Windows, when you say UNICODE, it is assumed that it's UTF-16 encoding. In the windows API, the default unicode encoding uses a
wchar_twhich is mapped to a 16 bit integer.
- on Linux, the preferred encoding for unicode is UTF-8. There's by the way an UTF-8 everywhere manifest that explains the rationale behind and try to promote this practice.