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

Uwe Oertel uweo at voelcker.com
Wed Oct 15 12:50:14 EDT 2003


Hello,

regarding the known problem using language specific character encoding,
I did a patch in unicode.h, unicode.c (mono/io-layer) and object.c
(mono/metadata)
that should now work for filenames and command line parameters.
It does convert the (internal) unicode string to a locale string, before
creating / opening a file in the file system (the other way around is 
implemented yet) and it now converts locale command
line parameters to UTF-8 before passing it to the regular gnome-lib /
mono - functions.

The following C# programs should work fine now, with locale encoding
settings
like LC_CTYPE = de_DE at euro:


// ---------------- 8< ------------------ >8 ---------------------

using System;
using System.IO;

namespace CreatePath
{
	public class CreatePath
	{
		public static void Main(string []args)
		{
			Directory.CreateDirectory(args[0]);
		}
	}
}

// ---------------- 8< ------------------ >8 ---------------------

// ---------------- 8< ------------------ >8 ---------------------

using System;
using System.IO;

namespace DirInfo
{
	public class DirInfo
	{
		public static void Main(string []args)
		{
			foreach(string currDirName in
Directory.GetFiles(args[0]))
			{
				Console.WriteLine(currDirName);
			}
		}
	}
}

// ---------------- 8< ------------------ >8 ---------------------

It would be of great help to us, if you could perform this patches.


Thanks a lot,

	Uwe Oertel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: io-layer.diff
Type: application/octet-stream
Size: 2762 bytes
Desc: io-layer.diff
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20031015/6b1214dd/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: metadata.diff
Type: application/octet-stream
Size: 2088 bytes
Desc: metadata.diff
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20031015/6b1214dd/attachment-0001.obj 


More information about the Mono-devel-list mailing list