From: N. R. <no...@co...> - 2004-10-28 23:54:10
|
Grzegorz Adam Hankiewicz wrote: >On 2004-10-26, "N. Roy" <no...@co...> wrote: > > >>Unicode is okay, but I am seeing some drawbacks. The size of a >>string of unicode isn't the same as the number of characters in it, >>which leads to problems allocating space. I needed to allocate the >>maximum size possible, six times the number of characters allowable. >>Of course my old code didn't do this so I had some overflows in >>a few places that drove me nuts trying to track down. I tell ya, >>I was really cursing unicode earlier today! heheh >> >> > >Don't use U_UTF8 then, use U_UNICODE which is two bytes per >character. The reason U_UTF8 is the default is because messages >using 7 bit only ASCII characters are forward compatible with utf8, >and thus old Allegro games using English messages show up correctly >with the new versions without changes to the code. > > Great, thanks for clarifying that for me. I was considering using another format with a fixed number of bytes but I wasn't sure how many bytes there would be and which to choose. U_UNICODE is two bytes, perfect, that's not too bad at all. I'm curious, under which circomstances would U_UTF8 ever need six bytes? Thanks in advance. -- Neil Roy "No one has ever gone into heaven" - John 3:13 |