[Mono-list] Traversing directories

Dick Porter dick@ximian.com
16 Jun 2003 13:49:00 +0100


On Mon, 2003-06-16 at 03:08, Jonathan Pryor wrote:
> Encoding is a tricky subject.  At this point, mono uses glib, which
> assumes that all filenames are encoded as UTF-8 strings.  This is an
> invalid assumption for your environment, resulting in bizarre program
> behavior.
>=20
> See:
> 	http://bugzilla.ximian.com/show_bug.cgi?id=3D30781
> 	http://bugzilla.gnome.org/show_bug.cgi?id=3D93751
>=20
> The fix is (should be?) to set the G_BROKEN_FILENAMES environment
> variable  (presumably to an empty string -- export G_BROKEN_FILENAMES=3D"=
"
> -- but this isn't clear from the above bug reports).

Unfortunately this doesn't work.  The only difference setting the env
var makes is to not spam the terminal with pointless g_warnings, iirc.

I'm rapidly coming to the conclusion that we will have to ditch glib for
locale encodings, because it's just not usable in the real world.
(Assuming that every file and every filename is utf-8 encoded is
bonkers.)  This work might be an ideal self-contained project for
someone looking for a way to contribute.

- Dick

>=20
>  - Jon
>=20
> On Sun, 2003-06-15 at 08:09, =D8yvind Hvamstad wrote:
> > Hi all. I have problems while traversing directories having names with=20
> > iso-8859-1 encoding. If a file has say an =E6, =F8 or =E5 in it,  the c=
all to=20
> > Directory.GetFiles(path) throws an System.NullReferenceException.
> > I tried searcing the archives on the subject, but was unable to find=20
> > anything.
> >=20
> > Can anyone please help?
>=20
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list