用adostream可以实现
integer li_rtn
OLEObject ole_ADOStream
ole_ADOStream = CREATE OLEObject
li_rtn = ole_ADOStream.ConnectToNewObject("ADODB.Stream")
ole_ADOStream.Position = 0 //Position为0才能设置Charset
ole_adostream.Type = 2 //二进制数据Binary
ole_ADOStream.Mode =3 //具有读/写权限
ole_ADOStream.Charset = "UTF-8"
ole_ADOStream.Open()
ole_ADOStream.WriteText("你的utf_8")
ole_ADOStream.Position = 0 //Position为0才能设置Charset
ole_ADOStream.Type = 2 //文本数据
ole_ADOStream.Charset = "GB2312"
ole_ADOStream.readtext(ls_data) //ls_data即为你想要的东东
ole_ADOStream.Close()
destroy ole_ADOStream
转自CSDN,未测试
阅读(6491) | 评论(0) | 转发(0) |