International Characters Support: Difference between revisions

m
Add note about C++ char16_t and char32_t
m (Format identifiers as fixed-width)
m (Add note about C++ char16_t and char32_t)
Line 28: Line 28:
What is important here is that usual characters should be declared as "chars" or "signed chars". "Unsigned char" means they MAY be submitted to truncation of the eighth bit, this is implementation-dependent.
What is important here is that usual characters should be declared as "chars" or "signed chars". "Unsigned char" means they MAY be submitted to truncation of the eighth bit, this is implementation-dependent.


In order to support "wide" characters with an extended range of values, the storage type <code>wchar_t</code> was added to the C standard. The size of <code>wchar_t</code> is system dependent: on Windows, it is 2 bytes, and on Linux and macOS it is 4 bytes. Functions whose argument is <code>wchar_t</code> instead of <code>char</code> are generally prefixed by "w".
In order to support "wide" characters with an extended range of values, the storage type <code>wchar_t</code> was added to the C standard. The size of <code>wchar_t</code> is system dependent: on Windows, it is 2 bytes, and on Linux and macOS it is 4 bytes. C++11 introduced defined-size wide character types <code>char16_t</code> and <code>char32_t</code>. Functions whose argument is <code>wchar_t</code> instead of <code>char</code> are generally prefixed by "w".


=Character functions=
=Character functions=
21

edits