Hi folks,
I have just noticed that UTF-8 files without BOM are recognised as ASCII.
Code: Select all
FileID = ReadFile(#PB_Any, file, #PB_File_SharedRead )
If FileID
FF = ReadStringFormat(FileID)
Debug FF
CloseFile(FileID)
EndIf
Notepadd++ or TotalCommander, for example, recognises the file type correctly. This means that there must be a way to recognise UTF-8 even without a BOM.
But how? Or is this a bug?
To test this, simply create a file with Notepad++ and save it as ASCII, UTF-8 and UTF-8 BOM.
ReadStringFormat() will recognise the Ascii and the UTF-8 file as #PB_Ascii and only UTF-8 BOM as UTF8-BOM.
Or just take the files from here:
https://u.pcloud.link/publink/show?code ... VItYmmPMry
Kind regards
Dige