1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| #include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
int main (int argc, char* argv[])
{
unsigned char UTF8_chars[] = {0xD9, 0x85, 0xD8, 0xB1, 0xD8, 0xAD, 0xD8,
0xA8, 0xD8, 0xA7, 0x20, 0xD8, 0xA8, 0xD8,
0xA7, 0xD9, 0x84, 0xD8, 0xB9, 0xD8, 0xA7,
0xD9, 0x84, 0xD9, 0x85};
// UTF-16 sequence
// wprintf(L"\u0645\u0631\u062D\u0628\u0627\u0020\u0628\u0627\u0644\u0639\u0627\u0644\u0645\n");
// wprintf(L"مرحبا بالعالم\n");
printf("\xD9\x85\xD8\xB1\xD8\xAD\xD8\xA8\xD8\xA7\x20\xD8\xA8\xD8\xA7\xD9\x84\xD8\xB9\xD8\xA7\xD9\x84\xD9\x85\n%s\n", UTF8_chars);
return EXIT_SUCCESS;
} |