[Mono-list] Non ASCII characters in file names

Jonathan Pryor jonpryor@vt.edu
Wed, 10 Sep 2003 21:19:51 -0400


The short answer is: Mono uses glib, which assumes that everything is in
UTF-8.  The filename you're seeing is likely a valid UTF-8 string; view
it in Nautilus or Rox and see if it looks right. :-)

See:
        http://bugzilla.ximian.com/show_bug.cgi?id=30781
        http://bugzilla.gnome.org/show_bug.cgi?id=93751

The fix is (should be?) to set the G_BROKEN_FILENAMES environment
variable  (to 1 -- export G_BROKEN_FILENAMES=1).

 - Jon

On Wed, 2003-09-10 at 11:50, Jörg Rosenkranz wrote:
> Hello,
> 
> We are failing to create files with non ASCII characters in their name
> using Mono functions. They are created with scrambled names.
> 
> Following example:
> 
> // ---------------- 8< ------------------ >8 ---------------------
> using System;
> using System.IO;
> 
> namespace Test
> {
> 	public class Test
> 	{
> 		public static void Main()
> 		{
> 			using ( StreamWriter wr = File.CreateText("Testäöü.txt") )
> 			{
> 				wr.WriteLine("Test");
> 			}
> 		}
> 	}
> }
> // ---------------- 8< ------------------ >8 ---------------------
> 
> The created filename looks like Testäöü.txt
> 
> When we create the file on the command line using
> 
> 	echo Test > Testäöü.txt
> 
> all works fine. Are there any Mono config options which affect this behaviour
> or is this a bug?
> 
> Thanks,
> Jörg
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list