[Mono-bugs] [Bug 79695][Min] Changed - Extra space characters issue when using System.Data.DataTable.Select

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Dec 16 17:27:39 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 neaorin at gmail.com.


--- shadow/79695	2006-10-18 18:29:47.000000000 -0400
+++ shadow/79695.tmp.24129	2006-12-16 17:27:39.000000000 -0500
@@ -1,14 +1,14 @@
 Bug#: 79695
 Product: Mono: Class Libraries
 Version: 1.1
+OS: unknown
 OS Details: OpenSuSE
 Status: NEW   
+Severity: Unknown
 Priority: Minor
 Component: Sys.Data
 AssignedTo: anagappan at novell.com                            
 ReportedBy: anagappan at novell.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -63,6 +63,52 @@
 		foreach (System.Data.DataRow row in dataTable.Select("Name =
+------- Additional Comments From neaorin at gmail.com  2006-12-16 17:27 -------
+A modified version of the test program reveals exactly which
+"whitespace" characters are ignored when comparing strings. The
+WhiteChars array below is from the String.cs class in corlib.
+using System;
+class MainClass {
+		private static readonly char[] WhiteChars = { (char) 0x9, (char)
+0xA, (char) 0xB, (char) 0xC, (char) 0xD,
+#if NET_2_0
+			(char) 0x85, (char) 0x1680, (char) 0x2028, (char) 0x2029,
+			(char) 0x20, (char) 0xA0, (char) 0x2000, (char) 0x2001, (char)
+0x2002, (char) 0x2003, (char) 0x2004,
+			(char) 0x2005, (char) 0x2006, (char) 0x2007, (char) 0x2008, (char)
+0x2009, (char) 0x200A, (char) 0x200B,
+			(char) 0x3000, (char) 0xFEFF };	
+	static void Main(string[] args)
+	{
+		System.Data.DataTable dataTable = new System.Data.DataTable("Person");
+		dataTable.CaseSensitive = true;
+		dataTable.Columns.Add("Name", typeof(string));
+		dataTable.Columns.Add("Code", typeof(int));
+		foreach (char c in WhiteChars) 
+			dataTable.Rows.Add(new object[] {"Mike" + c, c});
+		foreach (System.Data.DataRow row in dataTable.Select("Name = 'Mike'"))
+			System.Console.WriteLine(String.Format("0x{0:X}", row[1]));			
+	}
+The program only shows hex codes for chars which are ignored when
+found at the end of strings before doing the comparison. The .NET 2.0
+runtime outputs the following codes:
+0x20          (space)
+Mono only outputs
+I will post a patch & test case immediately.

More information about the mono-bugs mailing list