[DllImport("Api32.dll",CharSet=System.Runtime.InteropServices.CharSet.Ansi,EntryPoint="F_GetSummary", ExactSpelling=true)]
private static extern Int32 GetSummary
(
StringBuilder pBuffer, //字段内容
string   column, //字段名称
Int32 readSize 
);
该函数是取数据库中某个字段的内容,但当字段内容是一些其它国家的语言时显示出来是一堆?号,将CharSet设为CharSet.Unicode也不行,请高手指点!!!!!!!!

解决方案 »

  1.   

    那你把column再转换为UNICODE试一下啊
      

  2.   

    string型的变量已经是Unicode了吧?
      

  3.   

    呵呵,我估计这不是你写的程序的问题,而是你的Windows没有装好语言包吧:D
    你要提取的语言是哪国的?中东的吗?还是东亚的?在安装Windows的时候,把相应的语言包也安上就OK了.
      

  4.   

    应该不是这个问题吧?我也不知道那是哪个国家的语言.
    private static extern Int32 GetSummary
    (
    [Out]byte[] pBuffer, //字段内容
    string   column, //字段名称
    Int32 readSize 
    );
    但是把第二个参数改为byte[]时,主程序中:
    byte[] buffer=new byte[readSize*2];
    Encoding ToByte = Encoding.GetEncoding(54936);
    GetSummary(buffer, column, buffer.Length);
    ToByte.GetString(buffer)中得到的内容就显示正确.