Re: [AD] filename encoding again

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


On 8/5/07, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> I also renamed file_encoding to filename_encoding.
>
> I have no idea about the outstanding windows issues, so before applying,
> someone needs to look at those..

I think the Windows function should look something like this:

void _al_detect_filename_encoding(void)
{
#ifdef ALLEGRO_DMC
   /* DMC's C library does not support _wfinddata_t */
   set_filename_encoding(U_ASCII);
#else
   /* Windows NT 4.0, 2000, XP, etc support unicode filenames */
   set_filename_encoding(GetVersion() & 0x80000000 ? U_ASCII : U_UNICODE);
#endif
}

That code could be removed from wsystem.c then, since it will
automatically be called. And _al_win_unicode_filenames could be
removed and get_filename_encoding() could be used in its place (in
wfile.c).

Also maybe _al_detect_filename_encoding should return the encoding
instead of setting it. Probably doesn't really matter either way.

--
Matthew Leverton




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