0 کاربر و 1 مهمان درحال مشاهده موضوع.
#include <iostream>#include <codecvt>#include <locale>#include <string>using namespace std; int main(){ char16_t ch16 = u'ی'; wstring_convert< codecvt_utf8_utf16< char16_t >, char16_t > convert; string a = convert.to_bytes( u"This string has UTF-16 content" ); u16string b = convert.from_bytes( u8"امتحان" ); u16string c = u"UTF-16"; cout << a << endl; cout << b.size() << endl; cout << convert.to_bytes( b ) << endl << convert.to_bytes( c ) << endl << convert.to_bytes( ch16 ) << endl;}