Re: [AD] Windows unicode filename support

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


On Sunday 30 April 2006 15:34, Michal Molhanec wrote:
> Chris napsal(a):
> > Leave it to Windows to supply older systems with functions that don't do
> > anything for forwards "compatibility". Here's an alternative that uses
> > the original _stat/_findfirst/etc, but passes it UTF-8 data instead. I
> > doubt it'll work with the extended chars in Win9x (where I don't think
> > they can have extended chars), but hopefully it'll work in WinNT/2K/XP.
> > Can anyone test if it works properly with files that use extended
> > characters? If not, then I guess I'll either figure something else out.
>
> This patch makes no sense. ANSI Windows function expects strings in ANSI
> charset, not in UTF-8, so this patch does not work anywhere on Windows.

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.

> 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.




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