Create UTF-16 string from char*

后端 未结 3 1217
面向向阳花
面向向阳花 2021-01-25 02:31

So I have standard C string:

char* name = \"Jakub\";

And I want to convert it to UTF-16. I figured out, that UTF-16 will be twice as lo

3条回答
  •  遇见更好的自我
    2021-01-25 03:08

    Why do you want to make your own Unicode conversion functionality when theres's existing C/C++ functions for this, like mbstowcs() which is included in .

    If you still want to make your own stuff, then have a look at Unicode Consortium's open source code which can be found here:

    Convert UTF-16 to UTF-8 under Windows and Linux, in C

提交回复
热议问题