[Mono-bugs] [Bug 63981][Maj] Changed - Sorting of strings difference in .NET and Mono

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 31 Aug 2004 12:58:06 -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 lupus@ximian.com.

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

--- shadow/63981	2004-08-31 12:05:30.000000000 -0400
+++ shadow/63981.tmp.651	2004-08-31 12:58:06.000000000 -0400
@@ -102,6 +102,41 @@
 		}
 	}
 }
 
 ------- Additional Comments From dick@ximian.com  2004-08-31 12:05 -------
 The comment about Invariant culture still applies.
+
+------- Additional Comments From lupus@ximian.com  2004-08-31 12:58 -------
+Another small testcase to demostrate that none of the cultures on the
+MS runtime appears to ignore punctuation, they all behave like the
+invariant one for this comparison.
+
+using System;
+using System.Collections;
+using System.Globalization;
+
+class Class1 {
+
+	static int done = 0;
+	static void compare (int id) {
+		string str1 = "foo.obj";
+		string str2 = "foobar.obj";
+		CultureInfo ci = new CultureInfo (id);
+		if (ci == null)
+			return;
+		int res = String.Compare (str1, str2, false, ci);
+		if (res != -1)
+			Console.WriteLine ("compare {0} vs {1} not -1 in: {2}", str1, str2,
+ci.NativeName);
+		done++;
+	}
+	static void Main(string[] args) {
+		for (int i = 0; i < 0xffff; ++i) {
+			try {
+				compare (i);
+			} catch {
+			}
+		}
+		Console.WriteLine ("cultures tried: {0}", done);
+	}
+}