[Mono-bugs] [Bug 77482][Nor] Changed - DirectoryInfo.GetFiles() failes with international characters

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Feb 17 19:59:16 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by zac at zacbowling.com.

http://bugzilla.ximian.com/show_bug.cgi?id=77482

--- shadow/77482	2006-02-06 10:29:18.000000000 -0500
+++ shadow/77482.tmp.10956	2006-02-17 19:59:16.000000000 -0500
@@ -1,12 +1,12 @@
 Bug#: 77482
 Product: Mono: Class Libraries
 Version: 1.1
 OS: unknown
 OS Details: 
-Status: NEW   
+Status: ASSIGNED   
 Resolution: 
 Severity: Unknown
 Priority: Normal
 Component: System
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: stonebone at planetunreal.com               
@@ -105,6 +105,40 @@
 FileTest.exe björk
 björk does not exist.
 
 
 "björk" is "björk" encoded with UTF-8 (but the terminal is not using
 UTF-8).
+
+------- Additional Comments From zac at zacbowling.com  2006-02-17 19:59 -------
+MONO_EXTERNAL_ENCODINGS isn't used for filenames however support for
+this in files should be added if the operating system will allow
+international file names. 
+
+Currently the GetFileSystemEntries function calls to the private
+method System.IO.MonoIO.GetFileSystemEntries(...) which is an internal
+call back to ves_icall_System_IO_MonoIO_GetFileSystemEntries (after
+mapping) inside mono/mono/metadata/file-io.c. 
+
+The path passed to the function is UTF-16 and that function in C calls
+'path = mono_string_to_utf8 (_path)' to map the string to utf8 every
+time. 
+
+That utf-8 string is passed to mono_io_scandir(...) which is then
+simply passed to g_dir_open in glib. In the docs it says that the path
+variable of that function should be UTF-8 for win32, but the on disk
+encoding for any other system. 
+http://developer.gnome.org/doc/API/2.0/glib/glib-File-Utilities.html#g-dir-open
+
+Two solutions:
+We change this function to use the
+System.Text.Encoding.GetEncoding(...) functions to match to the system
+default locale (how ever we can get that). This method would make it
+so we are not dependent on ICONV.
+
+The secound method, we can pass the file name to the GLIB function
+g_filename_from_utf8 (...) and g_filename_to_utf8(...) and then the
+enviroment variable G_FILENAME_ENCODING could be used to specify the
+encoding of the filesystem.
+
+Example:
+export G_FILENAME_ENCODING=ISO-8859-1


More information about the mono-bugs mailing list