How to print the utf-16 characters in c

五迷三道 提交于 2020-02-05 03:29:08

问题


int main() 
{
    char c = 0x41;
    printf("char is : %c\n",c);

    c = 0xe9;
    printf("char is : %c\n",c);

    unsigned int d = 0x164e;
    printf("char is : %c\n",d);


    return 0;
}

What I want to print out are:

I use Ubuntu 64-bit VMware Workstation on windows and use Octal dump:

The hexadecimal value of the three chars from an utf-16 LE txt file.

The output:

How to print out utf-16 characters correctly?

来源:https://stackoverflow.com/questions/39576310/how-to-print-the-utf-16-characters-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!