zoukankan      html  css  js  c++  java
  • ANSI编码字符转化为UNICODE编码字符

    WCHAR* S2W(char* ansi)
    
    {
    
    int i;
    
    WCHAR* unicode;
    
    unicode = (WCHAR*) malloc ((strlen(ansi)+2)*sizeof(WCHAR));
    
    for (i = 0; i<(signed)strlen(ansi)+1; i++)
    
    unicode[i] = ansi[i];
    
    unicode[i] = 0;
    
    return unicode;
    
    }
    
     
    
    记得最后要释放unicode指针。

  • 相关阅读:
    POJ 1673
    POJ 1375
    POJ 1654
    POJ 1039
    POJ 1066
    UVA 10159
    POJ 1410
    POJ 2653
    POJ 2398
    POJ 1556
  • 原文地址:https://www.cnblogs.com/java20130722/p/3207214.html
Copyright © 2011-2022 走看看