Page 1 of 1
PB4 Win32 - bug or feature in saved v4 sources
Posted: Tue Aug 01, 2006 1:54 am
by va!n
While taking a look to some saved sources with PB4 final i noticed something mysterious in the header of saved sourcecodes. the first 3 bytes of those pb source files are defined by follwing, $EF $BB $BF followed by the normal source :roll:
If you try to load the source into v4 IDE, the first 3 mysterious chars (bytes) are not visible (cutted off) ... if you try to load the source into IDE v3.x you will see "  "
someone an idea?
Posted: Tue Aug 01, 2006 3:21 am
by ts-soft
This is the BOM-Header for UTF-8 Files. Is a feature, not a bug

Posted: Tue Aug 01, 2006 11:09 am
by Dare
It is, I think, conforming to the standards, so not a bug but actually right on the button?
Posted: Tue Aug 01, 2006 11:27 am
by inc.
http://en.wikipedia.org/wiki/Byte_Order_Mark
... as a marker to indicate that text is encoded in UTF-8, UTF-16 or UTF-32. ...
Its also supported by PB4s File commands as
ReadStringFormat() and WriteStringformat().
If using Readstringformat() as first on an opened text file and when the result is one of the PB UTF Codes the filepointer will be set behind the BOM marker, otherwise the filepointer wont be forwarded, means will be kept at the position before the Readstringformat() call. So using that command on an opened textfile is never bad

. This makes secure how to read properly the following character content by using the readstring commands with the needed flag