Re: Filename encodings and GLib



On Mon, 2003-10-13 at 17:14, Owen Taylor wrote:
> This is in reference to:
> 
>  http://bugzilla.gnome.org/show_bug.cgi?id=101792
>  
> Right now, the GLib model is that there are three forms for a filename:
> 
>  A) "System filename form" ... NUL terminated byte sequence,
>     no interpretation for user display
>  B) UTF-8 form. 
>  C) URI form
...
>  - We still haven't figured out whether URI's encode UTF-8
>    filenames or system filenames. Nautilus and GLib, I believe,
>    are inconsistent about this.

Yeah. Which is a bit unfortunate. The problem with URIs is of course
that we can't rely on the encoding of the filename in general, since the
file could be on e.g. a remote ftp server with unknown encoding. Another
issue is also that nautilus must be able to handle misencoded filenames
so they can be renamed to something correct.

> So, we'd need to provide wrapper functions for the C library functions
> that took our system filename form. The C standard functions that take
> filenames are, to my knowledge, remove(), rename(), tmpname(),
> fopen(), freopen().

There should probably be a g_win32_filename_to_codepage/widechar() or
something, if you want to pass the filename to other Win32 native
functions.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a deeply religious guitar-strumming boxer in a wheelchair. She's a 
wealthy blonde queen of the dead with an incredible destiny. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]