I have a file which is in UTF8 format and preceded by a BOM. In a Hex
editor it looks like this (BOM not shown):
Test1
T??st
Test2
Where the two ?? are the correct encoding for an a-umlaut.
I open the file with FileOpen in Linemode.
Read Line 1 -> returns Test1 with len 5
Read line 2 -> returns T<a-umlaut>st with len 5
Read line 3 -> returns "" with len 0
Read line 4 -> returns Test2 with len 5
Problem is now that the program either stops readng after line 2 or the
number of lines are wrong.
PB 11.2 / 8739
Regards
Arthur
Is the BOM correct? Quoting online help:
"A byte-order mark (BOM) is a character code at the beginning of a data
stream that indicates the encoding used in a Unicode file. For UTF-8, the
BOM uses three bytes and is EF BB BF. For UTF-16, the BOM uses two bytes and
is FF FE for little endian and FE FF for big endian."
You can always force the encoding to use, which will cause the fileopen to
fail if PB thinks the encoding (i.e., BOM) of the file is not that which was
requested.
Arthur
ls_file_contents = string(lblb_file_contents, EncodingUTF8!)
// Your line processor goes here:
// ...
Regards,
Ivaylo
"Arthur Hefti" <art...@catsoft.ch> wrote in message
news:4ace26c7@forums-1-dub...
Arthur
"Arthur Hefti" <art...@catsoft.ch> wrote in message
news:4acf1ecf$1@forums-1-dub...
Arthur