【发布时间】:2010-11-05 15:49:50
【问题描述】:
我的 Ubuntu 10.10 linux 下的 unicode 函数有问题。许多 unicode 函数无法正常工作。当我尝试以下简单代码时:
#include <wchar.h>
int main(int argc, char *argv[])
{
wprintf(L"test %s %s %s\n",L"one",L"two",L"three");
return 0;
}
使用g++编译(gcc版本4.4.5 Ubuntu/Linaro 4.4.4.-14ubuntu5)有如下结果:
test o t t
而不是预期:
test one two three
其他处理 unicode 字符串的函数也不能正常工作。我在 MS Windows 下开发的很多代码,这是我第一次尝试 linux 编程。
(同样的错误出现在我测试这个片段的两台 linux 机器上)
感谢您的任何建议。
【问题讨论】: