Page 1 of 1

No BOM detected

Posted: Tue Jun 25, 2013 3:10 pm
by IdeasVacuum
If ReadStringFormat() does not find a BOM, a format of #PB_Ascii is returned.

From the help:
"if no BOM is detected at the start of a file, it does not necessarily mean that it is a plain text file".
Indeed. I think ReadStringFormat() would serve better if it returned #PB_No_BOM rather than 'guessing' the file is #PB_Ascii, and #PB_Unknown_BOM if a detected BOM is unrecognised. I'm finding ReadStringFormat() is frequently returning #PB_Ascii when the file is UTF8, but without a BOM and I think this reflects the fact that Unicode text files are more prevalent today.

Edit: Not forgetting of course that UTF-8 is designed for backward compatibility with ASCII.

Edit: Related BOM issues:
http://www.purebasic.fr/english/viewtop ... 66#p433766
http://www.purebasic.fr/english/viewtop ... 13&t=55484