[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也不行,请高手指点!!!!!!!!
private static extern Int32 GetSummary
(
StringBuilder pBuffer, //字段内容
string column, //字段名称
Int32 readSize
);
该函数是取数据库中某个字段的内容,但当字段内容是一些其它国家的语言时显示出来是一堆?号,将CharSet设为CharSet.Unicode也不行,请高手指点!!!!!!!!
你要提取的语言是哪国的?中东的吗?还是东亚的?在安装Windows的时候,把相应的语言包也安上就OK了.
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)中得到的内容就显示正确.