#include #include int main(void) { printf("Hello \xF0\x9F\x8C\x8E\n"); printf("😀 has the unicode code point U+1F600.\n"); printf("It encodes in UTF-8 as 4 bytes: 0xF0 0x9F 0x98 0x80\n"); printf("We can output the 4 bytes like this: \xF0\x9F\x98\x80 (UTF-8)\n"); printf("Or like this: "); putchar(0xF0); putchar(0x9F); putchar(0x98); putchar(0x80); putchar('\n'); printf("Or like this: \U0001F600 (UTF-32)\n"); // UNICODE code point less than 0x10000 (ie the BMP) can be encoded with // \uXXXX (lowercase u) with only 4 hex digits // \U must always be followed by 8 hex digits printf("Here are some others that can be encoded in format \\uXXXX\n"); printf("\u2669 \u2669 \u266c \u266c\n"); printf("\u26C5 \u2614\n"); char *s = "\U0001F600"; printf("Strlen of %s is %ld...hmm...\n", s, strlen(s)); return 0; }