A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/c/string/multibyte/char32_t.html below:

char32_t - cppreference.com

char32_t is an unsigned integer type used for 32-bit wide characters and is the same type as uint_least32_t.

[edit] Notes

On any given platform, by the definition of uint_least32_t, the width of type char32_t can be greater than 32 bits, but the actual values stored in an object of type char32_t will always have a width of 32 bits.

[edit] Example
#include <stdio.h>
#include <uchar.h>
 
int main(void)
{
    const char32_t wc[] = U"zß水🍌"; // or "z\u00df\u6c34\U0001f34c"
    const size_t wc_sz = sizeof wc / sizeof *wc;
    printf("%zu UTF-32 code units: [ ", wc_sz);
    for (size_t n = 0; n < wc_sz; ++n)
        printf("%#x ", wc[n]);
    printf("]\n");
}

Possible output:

5 UTF-32 code units: [ 0x7a 0xdf 0x6c34 0x1f34c 0 ]
[edit] References
[edit] See also

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