pb6.5怎么把unicode乱码转成正常汉字?

lsypinghong 2017-04-24 08:23:04
integer li_fileone, li_filetwo

blob lb_text
string ls_native
li_fileone = FileOpen("D:\ua\Bin\wz.ini", StreamMode!)
// Move the file pointer so that Unicode
// identifying characters aren't copied
FileSeek(li_Fileone, 2)
// Read the data in the file into a blob
FileRead(li_fileone, lb_text)
FileClose(li_fileone)
// Convert the Unicode blob to a string
//ls_native=string(blob(lb_text,encodingutf16le!),encodingansi!)
//ls_native=Fromunicode(lb_text)
// Open a second file to copy the string to
li_filetwo = FileOpen("D:\ua\Bin\wz1.ini",StreamMode!, Write!)
FileWrite(li_filetwo, ls_native)
FileClose(li_filetwo)

提示没有定义fromunicode函数,怎么解?
...全文
776 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
猎奇567 2017-04-24
  • 打赏
  • 举报
回复
PB 6.5没Fromunicode这个函数。 建议调用win32 api: WideCharToMultiByte 可以把 Unicode strings 转换为 ANSI strings FUNCTION long WideCharToMultiByte(uint CodePage, ulong dwFlags, ref blob lpWideCharStr, long cchWideChar, ref blob lpMultiByteStr, long cbMultiByte, long lpDefaultChar,long lpUsedDefaultChar) Library "kernel32.dll" 我没用过这个函数,具体你进一步了解下。

1,077

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧