-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathunicode_types.cpp
More file actions
27 lines (22 loc) · 962 Bytes
/
unicode_types.cpp
File metadata and controls
27 lines (22 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//*****************************************************************************
//
// Author: Michael Price
// License: Attribution-NonCommercial-NoDerivs 3.0 Unported
// http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode
//
//*****************************************************************************
void unicodify ()
{
const char * iso88591 = "Hello World!";
const wchar_t * platform_encoding = L"hallå världen";
// Hallo Welt
const char * utf8 = u8"\x48\x61\x6C\x6C\x6F"
u8"\x20\x57\x65\x6C\x74";
// Hello World -> Shalom Olam (but in Hebrew script)
const char16_t * utf16 = u"\u05E9\u05DC\u05D5\u05DD"
u"\u05E2\u05D5\u05DC\u05DD";
// Hello World + some SMP chars (Simplified Chinese)
const char32_t * utf32 = U"\u4F60\u597D\u4E16\u754C"
U"\U00020027\U00020929"
U"\U00021A3A\U00021F6B";
}