[Mono-bugs] [Bug 53044][Wis] New - CultureInfo not working, it seems not complete

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 19 Jan 2004 00:21:39 -0500 (EST)


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 kelvin.ho@kawai.ca.

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

--- shadow/53044	2004-01-19 00:21:39.000000000 -0500
+++ shadow/53044.tmp.2892	2004-01-19 00:21:39.000000000 -0500
@@ -0,0 +1,105 @@
+Bug#: 53044
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: XP SP1
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: kelvin.ho@kawai.ca               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CultureInfo not working, it seems not complete
+
+Description of Problem:
+CultureInfo not quite complete
+Mono 0.29
+
+Steps to reproduce the problem:
+1. mcs k5.cs
+2. mono k5.exe
+
+k5.cs:
+using System;
+using System.Globalization;
+
+public class K5
+{
+  public K5()
+  {
+  }
+
+  public Int32 Test()
+  {
+     if( CultureInfo.CurrentCulture == null )
+    {
+      Console.WriteLine( "CultureInfo.CurrentCulture = null" );
+    }
+    else
+    {
+      Console.WriteLine( "'" + CultureInfo.CurrentCulture + "'" );
+      if( CultureInfo.CurrentCulture.CompareInfo == null )
+      {
+        Console.WriteLine( "CultureInfo.CurrentCulture.CompareInfo = 
+null" );
+      }
+      else
+      {
+        Console.WriteLine( "'" + CultureInfo.CurrentCulture.CompareInfo 
++ "'" );
+        CultureInfo.CurrentCulture.CompareInfo.Compare
+( "Kelvn", "Kelvin", Compa
+reOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | 
+CompareOptions.IgnoreCas
+e );
+      }
+    }
+  }
+
+  public static void Main()
+  {
+    K5 K5 = new K5();
+    K5.Test();
+  }
+}
+
+Actual Results:
+On Windows XP with Mono 0.29:
+''
+'CompareInfo - 127'
+
+Unhandled Exception: System.SystemException: A system exception has 
+occurred.
+in (unmanaged) (wrapper managed-to-native) 
+System.Globalization.CompareInfo:inte
+rnal_compare (string,string,System.Globalization.CompareOptions)
+in <0x00004> (wrapper managed-to-native) 
+System.Globalization.CompareInfo:intern
+al_compare (string,string,System.Globalization.CompareOptions)
+in <0x0001a> System.Globalization.CompareInfo:Compare 
+(string,string,System.Glob
+alization.CompareOptions)
+in <0x00068> .K5:Test ()
+in <0x00036> .K5:Main ()
+
+On SuSE 8.0 with Mono 0.28:
+'iv'
+'CultureInfo.CurrentCulture.CompareInfo = null'
+
+Expected Results:
+'en-US'
+'CompareInfo - 1033'
+
+How often does this happen? 
+Every time
+
+Additional Information:
+What is returned by CultureInfo.CurrentCulture
+CultureInfo.CurrentCulture.CompareInfo may be acceptable, but
+it is certainly different from what .NET CLR returns.
+I also tried this on SuSE 8.0 with Mono 0.28, it fails differently.