保存文件时,我不想使用系统默认的字符集,自己设定为日文,或者大5码等等,应该怎么做?

解决方案 »

  1.   

    我只知道要保存成UNICODE格式文件,需要在文件头上加0xfeff标识,不知道和你说的是不是同一回事情
      

  2.   

    那要改变编码方式的。
    先MultiByteToWideChar把你原来的内容转换为UNICODE,然后再使用WideCharToMultiByte转化为你需要的编码方式
      

  3.   

    MultiByteToWideChar可以指定codepage的。
      

  4.   

    MultiByteToWideChar 
    This function is only accurate for character values less than 128. Characters whose values are greater may not be compared accurately because the 16-bit implementation does not have the necessary Unicode mapping tables; it does not support Unicode single-byte conversion; works reliably only for ASCII characters.  
    msdn有说该函数可以指定系统中有的任何字体,但是又没具体说明,还说win32下面该函数由这些限制?是不是说,这函数在win32下面不好用呢?
    codepage具体如何指定?
    请指教!!!
      

  5.   

    这函数在win32下用没问题的。
    codepage 如何指定看这个表:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcepb40/html/_wcepb_Selecting_Code_Pages.asp