Converts a blob containing an ANSI character string to a Unicode string.
FromAnsi ( blob )
Argument |
Description |
---|---|
blob |
A blob containing an ANSI character string you want to convert to a Unicode string |
String. Returns a character string if it succeeds and an empty string if it fails.
The FromAnsi function converts an ANSI character string contained in a blob to a Unicode character string.
Unicode file format Unicode files sometimes have two extra bytes at the start of the file to indicate that they are Unicode files. If the two bytes are missing, PocketBuilder assumes “little endian” format.
This example reads a blob containing an ANSI character string from a file called ansi.txt and converts it into a string:
integer li_filenum
blob lb_text
string ls_native
li_filenum = FileOpen("ansi.txt", StreamMode!)
FileRead(li_filenum, lb_text)
ls_native = FromAnsi(lb_text)
FileClose(li_filenum)