(Note: Currently all my programs are compiled with the "Create unicode executable" checked.)
This example code, without the #PB_Unicode flag on each WriteLineN line causes a later ReadData to misread the file. (ReadData and WriteData appear to stick with whatever mode the "Create unicode executable" flag defines).
Code: Select all
CreateFile(1,"C:\100\pb400\APPLICATIONS\IVMGlobal\data\lang_English.txt")
WriteStringN(1,"[LOGIN]")
WriteStringN(1,"?username=YOUR USER NAME")
WriteStringN(1,"?userpass=YOUR PASSWORD")
WriteStringN(1,"?button=LOG IN")
WriteStringN(1,"[/LOGIN]")
CloseFile(1)
Now adding the flags is no problem, and then everything works. But I am curious as to why UTF8 and not unicode is used as default.
Also, is UTF8 preferable (apart from file sizes) and will it support things like Turkish and Hebrew? (My app is likely to move into those markets within the year, whether I like it or not.)
If UTF8 has advantages, how do you create a UTF8 executable? Is there even such a thing?
lol - I am so glad PureBasic does most of the Unicode work as unicode has me confused.
Even within Pure every so often I encounter a curly. This is not a big curly, the fix is easy (#PB_Unicode flags) - but communicating with a webserver via API cost me some hair.
