Home > database >  Pb6.5 how to convert unicode garbled to normal Chinese characters?
Pb6.5 how to convert unicode garbled to normal Chinese characters?

Time:10-12

The 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! The Write!
FileWrite (li_filetwo ls_native)
FileClose (li_filetwo)

Tip no fromunicode defined function, how to solve?

CodePudding user response:

6.5 no PB Fromunicode the function,

Advice calls win32 API:
WideCharToMultiByte can convert Unicode strings to ANSI strings

The FUNCTION long WideCharToMultiByte (uint CodePage, ulong dwFlags, ref blob lpWideCharStr, long cchWideChar, ref blob lpMultiByteStr, long cbMultiByte, long lpDefaultChar, long lpUsedDefaultChar) Library "kernel32. DLL
"

I've never used this function, specific you further understand,




  • Related