Psych wrote:I don't really think I am.
but you are. you complain about reading/writing strings and so on. it doesnt matter how the strings are internally stored. everything you could do with ascii, you can do with unicode, only that japanese, russian etc. executables will show proper characters on every pc now, no matter what language you use.
you can read an ascii string from a file, with the proper #PB_Ascii flag and it will be automatically converted to unicode. then you can modify it as much as you want and write it back as ascii if you like. nothing changes, unless you need direct in-memory access. either way, you only need a little bit more code.
you also said that you havent seen any real world applications that uses unicode. 2 byte wide char unicode (ucs2/utf16) is the default layer on any windows system since windows 2000 and 95% of apps use it, including every microsoft app and driver.
oh and speaking of overhead, the legacy ascii support is done by the unicode layer as well and everything you see on your screen is in fact unicode.
Psych wrote:However wouldn't UTF8 be better as the standard?
microsoft only has ascii and unicode functions:
Code: Select all
MessageBoxW_() (Unicode)
MessageBoxA_() (ANSI)
thats why there is no such thing as an utf8 function. utf8 is a format mainly designed for text files, which offers backward compatibility to the first 127 ascii characters. html, xml, php and even your pb source code is nothing else than a text file and can be processed by ascii and unicode executables alike. the browser you are viewing this page with, is a unicode executable.
Psych wrote:I am pretty sure it was because of limitations with addressing, not because they didn't like ascii.
limitations are exactly the reason why ascii was abandoned. same as 16bit executables were abandoned and 32bit executables will be abandoned one day too. in unicode there are currently more than 100.000 codepoints assigned, while ascii only has 255, where only the first 127 are always the same.
Psych wrote:You think the average PC has 16gb RAM? Try 4 or 8. I can only assume you develop applications with little or no regard for memory usage. That is also your choice.
4gb has been mainstream since the 64bit version of windows vista, which was released in 2007. even if you only had 1gb, you could open up a 10gb file by using file mapping, like hex editors do since many many years now. and you worry about the extra 1-2kb of your executable?
c ya,
nco2k