Convert ASCII string to Unicode? Windows, pure C

后端 未结 6 873
滥情空心
滥情空心 2021-01-13 06:08

I\'ve found answers to this question for many programming languages, except for C, using the Windows API. No C++ answers please. Consider the following:

#inc         


        
6条回答
  •  终归单人心
    2021-01-13 07:04

    MultiByteToWideChar:

    #include 
    char *string = "The quick brown fox jumps over the lazy dog";
    size_t len = strlen(string);
    WCHAR unistring[len + 1];
    int result = MultiByteToWideChar(CP_OEMCP, 0, string, -1, unistring, len + 1);
    

提交回复
热议问题