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:
> There was a 6 month long discussion during the latter half of 2006
> under the name of "Allegro unable to deal with non ascii filenames". I
> haven't read through it, but the current way its handled seems like a
> bad way of doing it. (There's no central point for setting the
> encoding, etc.)

Also I think Grzegorz had a more complete proposal for deal with file name
encodings.

> I'm guessing that set_file_encoding and get_file_encoding are supposed
> to be public. I don't really like the names of the functions though
> because it's the file _name_ (or path) encoding that's being set. As
> is, it sounds like its the encoding of the file itself. So maybe its
> best that they haven't been documented yet.
> 
> I would think the best way of handling this would be to make those
> functions public, rename them to something that's better, and create a
> default case:
> 
> void set_filename_encoding(int encoding)
> {
>   if (encoding == AUTODETECT_FILENAME_ENCODING   /* for lack of a
> better constant name... */)
>   {
>     // auto detect
>   }
>   else
>     filename_encoding = encoding;
> }
> 
> install_allegro could then call
> set_filename_encoding(AUTODETECT_FILENAME_ENCODING) and we wouldn't
> have to worry about any system driver forgetting to set it.

Ok, I won't try and get this resolved for 4.2.2.  I'll commit your
original patch from the start of the thread.  It's not any worse than
4.2.1, at least.

Peter





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