Re: [AD] dmc unicode patch

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


On 2007-07-21, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> On 7/21/07, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> > Can I get a patch to this effect?  Then I think I can release 4.2.2
> > tomorrow, unless you want to resolve the OSX universal binaries first?
> >
> I made the changes, and then MinGW32 broke. The problem was that under
> SYSTEM_NONE the file encoding doesn't get set to Unicode. So the
> various _w* functions are sent non-unicode strings and they fail.
> (Before it didn't matter because the unicode functions were never
> called under console mode.) I can do the following to fix that:
> 
> static int sys_none_init(void)
> {
> #if defined(ALLEGRO_WINDOWS)
> 	if (_al_win_unicode_paths()) {
> 	  set_file_encoding(U_UNICODE);
> 	}
> #endif
> 	return 0;
> }
> 
> But what about other UNIX and OS X? I see there is a
> _unix_guess_file_encoding() that a few of the ports call. Are they
> never called under system none?

You're right.  I did a test and pack_fopen can't open UTF-8 filenames if
SYSTEM_NONE is used.  So this change was incomplete:

    r5863 (orig r5816):  elias | 2006-05-30 23:05:01 +1000

    Chris fixed some problems with non-ASCII filenames under Windows,
    and also made it work again under Win98.  me and Chris fixed
    problems for UTF8 filenames under Unix, as reported by Grzegorz. Non
    ascii non utf8 filenames remain broken.

It also added set_filename_encoding and get_filename_encoding but they
were never documented.  So, are they supposed to be public or not?

Peter





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