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函式,怎么解?
uj5u.com熱心網友回復:
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"
我沒用過這個函式,具體你進一步了解下。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/21282.html
標籤:基礎類
