Re: [AD] Windows unicode filename support

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Chris napsal(a):
UTF-8 is fully compatible with 7-bit ASCII, so only characters with a value greater than 127 will be affected. And since Allegro was converting it all to ASCII before, nothing is lost from previous versions.

Sure it is lost. In current versions is the file name displayed wrong, but works. After applying your patch they are displayed not only wrong, but also doesn't work.

If you really (but IMHO it's not important for a game library) want to
it correctly, convert it to U_UNICODE and the result pass to the
WideCharToMultiByte with first parameter CP_ACP and then the result pass
to the _stat & co. functions

Isn't that basically what Allegro's convert functions already do? I don't think using code pages is particularly right in this day and age, now that we have Unicode. And given that coders aren't always native English speakers, it'd be nice to assume they may want to use non-English filenames.

Watch this. I try to say it slowly.
1. wstat returns 0 on win9x
2. stat expected file names in ANSI (e.g. cp1250) charset
Conclusion: if you want to support win9x and non-English characters, you have to convert file name to ANSI charset first and than pass it to stat. There is now other way which will work correctly. If you don't agree try to read this again :-) until you will see the light...

--
Regards,
    Michal

ICQ# 175762750




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/