有一个文件,写的全是字母,但是unicode方式存储的
我想一行一行读这个文件
读完一行,把它转换成单字节的方式
有这样的api吗?

解决方案 »

  1.   

    MultiByteToWideChar是将一个字符串转成Unicode字符串
    WideCharToMultiByte才是将Unicode字符串转成普通的字符串
      

  2.   

    Unicode and Character Set Functions
    The following functions are used with character sets. Function Description 
    GetTextCharset 
    Retrieves a character-set identifier for the font that is currently selected into a specified device context. GetTextCharsetInfo 
    Retrieves information about the character set of the font that is currently selected into a specified device context. IsDBCSLeadByte 
    Determines whether a character is a lead byte. IsDBCSLeadByteEx 
    Determines whether a character is a lead byte. IsTextUnicode 
    Determines whether a buffer is likely to contain a form of Unicode text. MultiByteToWideChar 
    Maps a character string to a wide-character (Unicode) string. 
    TranslateCharsetInfo Translates based on the specified character set, code page, or font signature value. WideCharToMultiByte 
    Maps a wide-character string to a new character string.