[Mono-bugs] [Bug 58775][Blo] New - I18N libs not opened via GAC, Encoding class failing

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 20 May 2004 17:37:28 -0400 (EDT)


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 eb@zombie.inka.de.

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

--- shadow/58775	2004-05-20 17:37:26.000000000 -0400
+++ shadow/58775.tmp.23936	2004-05-20 17:37:26.000000000 -0400
@@ -0,0 +1,74 @@
+Bug#: 58775
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: Debian Sid,  mono 0.91
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: eb@zombie.inka.de               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: I18N libs not opened via GAC, Encoding class failing
+
+Description of Problem:
+
+Hello,
+
+while packaging mcs-0.91 for Debian we stepped over a problem with i18n
+where mono 0.31 was running without problems before. We use standard ICU
+lib installation (2.8) with icu-data compiled into libs. With the code
+below, we get this error message:
+
+Unhandled Exception: System.NotSupportedException: Encoding name
+`ISO-8859-15' not supported
+in <0x002dd> System.Text.Encoding:GetEncoding (string)
+in <0x0002f> MainClass:Main ()
+
+However, since mono-0.31 worked fine, we looked for a possible reason in
+the class libs and found it in a strace session: the I18N* dll are not
+opened via the GAC methods, they are expect on their _default_ location in
+/usr/lib. After we have created provisoric symlinks in /usr/lib, i18n
+worked like a charm.
+
+using System;
+using System.Text;
+using System.IO;
+
+public class MainClass {
+   public static void Main() {
+      String theString;
+      System.Text.Encoding foo =
+System.Text.Encoding.GetEncoding("ISO-8859-15")
+;
+      System.Text.Encoding bar = System.Text.Encoding.GetEncoding("KOI8-R");
+
+      StreamReader reader = new System.IO.StreamReader("testfile.txt",
+System.Te
+xt.Encoding.Default);
+      try
+      {
+         theString = reader.ReadToEnd();
+      }
+      finally
+      {
+         reader.Close();
+      }
+         StreamWriter writer = new System.IO.StreamWriter("out.txt", false,
+bar)
+;
+      try
+      {
+         writer.WriteLine(theString);
+      }
+      finally
+      {
+         writer.Close();
+      }
+   }      
+}