Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/146.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试使用C+;打印时,Unicode范围超出了范围+; 我尝试在C++中打印Unicode字符。我的Unicode字符是古突厥语,我有字体。当我使用一个字母的代码时,它会给我另一个字符。例如: #include <iostream> #include <string> using namespace std; int main() { string str = "\u10C00" // My character's unicode code. cout << str << endl; return 0; } #包括 #包括 使用名称空间std; int main() { string str=“\u10C00”//My字符的unicode代码。 cout_C++_Unicode_Character - Fatal编程技术网

尝试使用C+;打印时,Unicode范围超出了范围+; 我尝试在C++中打印Unicode字符。我的Unicode字符是古突厥语,我有字体。当我使用一个字母的代码时,它会给我另一个字符。例如: #include <iostream> #include <string> using namespace std; int main() { string str = "\u10C00" // My character's unicode code. cout << str << endl; return 0; } #包括 #包括 使用名称空间std; int main() { string str=“\u10C00”//My字符的unicode代码。 cout

尝试使用C+;打印时,Unicode范围超出了范围+; 我尝试在C++中打印Unicode字符。我的Unicode字符是古突厥语,我有字体。当我使用一个字母的代码时,它会给我另一个字符。例如: #include <iostream> #include <string> using namespace std; int main() { string str = "\u10C00" // My character's unicode code. cout << str << endl; return 0; } #包括 #包括 使用名称空间std; int main() { string str=“\u10C00”//My字符的unicode代码。 cout,c++,unicode,character,C++,Unicode,Character,std::string实际上不支持unicode,请改用std::wstring。 但即使是std::wstring也可能有问题,因为它不支持所有大小 如果使用gtkmm或Qt时使用QString,另一种方法是使用一些外部字符串类,例如Glib::ustring 几乎每个GUI工具包和其他库都提供自己的字符串类来处理unicode。std::string并不真正支持unicode,请改用std::wstring。 但即使是std::wstring也可能有问题,因为它不支持所有大小 如果使用gtk

std::string
实际上不支持unicode,请改用
std::wstring
。 但即使是
std::wstring
也可能有问题,因为它不支持所有大小

如果使用gtkmm或Qt时使用
QString
,另一种方法是使用一些外部字符串类,例如
Glib::ustring


几乎每个GUI工具包和其他库都提供自己的字符串类来处理unicode。

std::string
并不真正支持unicode,请改用
std::wstring
。 但即使是
std::wstring
也可能有问题,因为它不支持所有大小

如果使用gtkmm或Qt时使用
QString
,另一种方法是使用一些外部字符串类,例如
Glib::ustring


几乎每个GUI工具包和其他库都提供了自己的字符串类来处理unicode。

转义后
/u
必须正好是4个十六进制字符。如果需要更多字符,应该使用
/u
。第二个变体需要8个字符

示例:

"\u00D6"      // 'Ö' letter
"\u10C00"     // incorrect escape code!
"\U00010C00"  // your character

转义后
/u
必须正好是4个十六进制字符。如果需要更多字符,应使用
/u
。第二个变体需要8个字符

示例:

"\u00D6"      // 'Ö' letter
"\u10C00"     // incorrect escape code!
"\U00010C00"  // your character

std::wstring
支持私用是吗?因为如果我的试验成功,我将使用该区域,因为我有一个涉及多种古代语言的项目。我不确定这一点,请看以下示例:
std::wstring
支持私用是吗?因为如果我的试验成功,我将使用该区域,sinc我有一个涉及多种古代语言的项目。我不确定,例如: