[Mono-bugs] [Bug 72081][Nor] New - CultureInfo.GetCultures(CultureTypes.AllCultures) does not include CultureType.InvariantCulture

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 1 Feb 2005 18:13:45 -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 fmatch@cfl.rr.com.

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

--- shadow/72081	2005-02-01 18:13:45.000000000 -0500
+++ shadow/72081.tmp.21479	2005-02-01 18:13:45.000000000 -0500
@@ -0,0 +1,65 @@
+Bug#: 72081
+Product: Mono: Class Libraries
+Version: unspecified
+OS: other
+OS Details: Fedora Core 2
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: fmatch@cfl.rr.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CultureInfo.GetCultures(CultureTypes.AllCultures) does not include CultureType.InvariantCulture
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+CultureInfo.GetCultures(CultureTypes.AllCultures) does not include 
+CultureType.InvariantCulture as Microsoft.NET runtime does and results in 
+broken code.
+
+Steps to reproduce the problem:
+1. Compile:
+using System;
+using System.Globalization;
+
+public class MyClass
+{
+	public static void Main()
+	{
+		CultureInfo invariant = CultureInfo.InvariantCulture;
+		CultureInfo[] infos = CultureInfo.GetCultures
+(CultureTypes.AllCultures);
+		bool foundIt = false;
+		foreach(CultureInfo culture in infos)
+		{
+			if(culture.Equals(invariant))
+			{
+				foundIt = true;
+				break;
+			}
+		}
+		Console.WriteLine("Found it: {0}\n",foundIt);
+	}
+}
+
+2. Run: mono MyClass.exe
+
+
+Actual Results:
+Found it: False
+
+Expected Results:
+Found it: True
+
+How often does this happen? 
+Always with versions 1.0.5 and 1.1.3
+
+Additional Information:
+CultureInfoEntry culture_entries [], in file culture-info-tables.h, does 
+not include an entry for the Invariant Culture.