Page 1 of 1
Default for read/write string operations for unicode program
Posted: Thu Dec 10, 2015 7:12 pm
by Demivec
#PB_Ascii : all read/write string operation will use ascii if not specified otherwise (default for ASCII executable).
#PB_UTF8 : all read/write string operation will use UTF-8 if not specified otherwise (default for Unicode executable).
#PB_Unicode: all read/write string operation will use Unicode if not specified otherwise.
Currently (as of v5.41b2) the default for OpenFile(), CreateFile(), and ReadFile() in a Unicode executible is to use #PB_UTF8 for all read/write string operations unless otherwise specified.
I request that #PB_Unicode be used instead.
Re: Default for read/write string operations for unicode pro
Posted: Thu Dec 10, 2015 7:26 pm
by sys64802
Why you would like this to be changed ?
And for what reason UTF8 was chosen instead ?
Re: Default for read/write string operations for unicode pro
Posted: Thu Dec 10, 2015 7:59 pm
by Demivec
sys64802 wrote:Why you would like this to be changed ?
And for what reason UTF8 was chosen instead ?
IMHO it is more consistent for #PB_Unicode to be the standard for a unicode executible. (See your second question

)
Re: Default for read/write string operations for unicode pro
Posted: Thu Dec 10, 2015 8:41 pm
by ts-soft
Most written Text a in UTF-8, this is the standard for writing Text, Config Files, HTML and so on. The default of UTF-8 should be okay.
Re: Default for read/write string operations for unicode pro
Posted: Thu Dec 10, 2015 8:44 pm
by kenmo
Nooooooo, -1 vote from me
I am glad the team is making UTF-8 the default for more and more functions. I consider it the best encoding for any text that goes "outside the program" (file I/O, networking, communicating with other executables, ...).
UTF-8 has lots of benefits:
- handles ALL Unicode characters (up to 4-byte characters)
- no endianness confusion (and no BOM needed)
- backwards compatible with ASCII text
- NULL bytes never appear, so they can be used as terminators just like in ASCII
- standard encoding for XML, JSON (HTML?)
- Western languages (including most programming and markup languages) take up minimal space (no NULLs every other byte)
- many more, see
http://utf8everywhere.org/ and
https://en.wikipedia.org/wiki/UTF-8
The choice for PureBasic Unicode to use UCS-2 encoded strings in memory is OK (but has some critics around here), but I don't know hardly any programs that use UCS-2 for files.
Re: Default for read/write string operations for unicode pro
Posted: Thu Dec 10, 2015 9:26 pm
by Demivec
Based on each of the replies I have concluded that I was being shortsighted. I withdraw my request.