++ Unicode, , , .
, ++ Unicode . , , (, , ASCII-7 @, $, backtick).
++ 98 Unicode. wchar_t wstring, , wchar_t " ". , ...
Microsoft wchar_t 16 , Unicode . Unicode 16- ... 16- Windows wchar_t "", BMP - Microsoft, , , wchar_t UTF-16 ( ) UCS-2 ( BMP).
Linux wchar_t 32 , UTF-32...
++ 11 , char16_t char32_t, string, , Unicode.
, , . "Fuß" , , . ( 'ß' 'SS', - , ).
. Unicode (ICU) Unicode ++. , u8"", u"" u"" UTF-8, UTF-16 UTF-32 , /hexadecimal escapes , ASCII-7.
std::cout << ramp[5], ++ . ICU ustream.h operator<< icu::UnicodeString, ramp[5] - 16- (1), , unsigned short , C-API u_fputs()/u_printf()/u_fprintf().
#include <unicode/unistr.h>
#include <unicode/ustream.h>
#include <unicode/ustdio.h>
#include <iostream>
int main()
{
icu::UnicodeString ramp( icu::UnicodeString::fromUTF8( "ÐðŁłŠšÝýÞþŽž" ) );
std::cout << ramp << "\n";
std::cout << ramp[5] << "\n";
u_printf( "%C\n", ramp[5] );
}
g++ -std=c++11 testme.cpp -licuio -licuuc.
ÐðŁłŠšÝýÞþŽž
353
š
(1) ICU UTF-16 , UnicodeString::operator[] , , . API .