Re: [AD] Allegro unable to deal with non ascii filenames

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


On Sunday 28 May 2006 06:54, Jon Rafkind wrote:
> What if Allegro tried to write out a UTF8 file, or something, at startup
> and then read it back in using a variety of methods until one of them
> works.

Whatever you write, you'll get back. If I create a filename with the bytes 
0xC0 0x86, then use readdir and get that file, I'll see those two bytes, 
always. You'll not be any wiser. You'll have to know what those bytes mean to 
get any real information. The issue is Allegro is assuming UTF-8 in ufile.c 
and the ASCII default with unlink/open (and when it converts to/from an 
improper ASCII codepage from UTF-8, you'll mix up/lose the extended 
characters).

All it should take is to read the LC_* vars or LANG, figure out the encoding 
(UTF-8, or some codepage), and tell Allegro to use that for filename 
conversions. Since Allegro uses UTF-8 internally by default, on UTF-8 
systems, it'll not need any conversion. But on systems that have a codepage 
set, it'll properly convert from that codepage (assuming Allegro has it) to 
UTF-8 and it'll display the proper characters (assuming also Allegro has a 
proper font). It'll also convert from UTF-8 to the proper codepage before 
sending it to the system.




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