[Mono-devel-list] RE: patch for: Non ASCII characters infilenames/ command line parameters

Jörg Rosenkranz joergr at voelcker.com
Tue Oct 21 06:41:49 EDT 2003

Hello Gaute,

> -----Original Message-----
> From: Gaute B Strokkenes [mailto:biggaute at uwc.net] 
> Sent: Tuesday, October 21, 2003 12:09 PM
> G_BROKEN_FILENAMES is what GTK uses these days.
> Viz.  <http://www.gtk.org/gtk-2.2.0-notes.html>:
> * The assumption of GLib and GTK+ by default is that filenames on the
>   filesystem are encoded in UTF-8 rather than the encoding of 
> the locale;
>   The GTK+ developers consider that having filenames whose 
> interpretation
>   depends on the current locale is fundamentally a bad idea.
>   If you have filenames encoded in the encoding of your locale, then
>   you may want to set the G_BROKEN_FILENAMES environment variable:
>   Best integration of GTK+-2.2 with the environment is achieved by 
>   using a UTF-8 locale.

G_BROKEN_FILENAMES doesn't work in this context. If you look into
io.c you find following code in CreateDirectory (only one example):

	utf8_name = _wapi_unicode_to_utf8 (name);
	result = mkdir (utf8_name, 0777);

The filename is *always* encoded as UTF8, regardless of the system 
locale. Using the current locale may be a bad idea, but that's what
major distributions do today (in our case SuSE). And if we want to 
run our applications on customer's systems we have to support that.


More information about the Mono-devel-list mailing list