char16_t is an unsigned integer type used for 16-bit wide characters and is the same type as uint_least16_t.
[edit] NotesOn any given platform, by the definition of uint_least16_t, the width of type char16_t can be greater than 16 bits, but the actual values stored in an object of type char16_t will always have a width of 16 bits.
[edit] Example#include <stdio.h> #include <uchar.h> int main(void) { const char16_t wcs[] = u"zÃæ°´ð"; // or "z\u00df\u6c34\U0001f34c" const size_t wcs_sz = sizeof wcs / sizeof *wcs; printf("%zu UTF-16 code units: [ ", wcs_sz); for (size_t n = 0; n < wcs_sz; ++n) printf("%#x ", wcs[n]); printf("]\n"); }
Possible output:
6 UTF-16 code units: [ 0x7a 0xdf 0x6c34 0xd83c 0xdf4c 0 ][edit] References
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4