[Mono-bugs] [Bug 71289][Nor] Changed - DateTime.Parse should allow this string.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon May 23 13:47:29 EDT 2005


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 bmaurer at users.sf.net.

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

--- shadow/71289	2005-05-23 13:35:10.000000000 -0400
+++ shadow/71289.tmp.31017	2005-05-23 13:47:29.000000000 -0400
@@ -29,6 +29,79 @@
 		Console.WriteLine ("OK");
 	}
 }
 
 ------- Additional Comments From bmaurer at users.sf.net  2005-05-23 13:35 -------
 It seems that msft allows spaces and punctuations in side DateTime.
+
+------- Additional Comments From bmaurer at users.sf.net  2005-05-23 13:47 -------
+I ran the following test on msft:
+
+using System.Globalization;
+using System;
+
+class X {
+	static int [] pass = new int [(int)UnicodeCategory.OtherNotAssigned+1];
+	static int [] fail = new int [(int)UnicodeCategory.OtherNotAssigned+1];
+	static void Main ()
+	{
+		for (char c = Char.MinValue; c < Char.MaxValue; c ++)
+		{
+			int idx = (int)Char.GetUnicodeCategory (c);
+			if (Try (c))
+				pass [idx] ++;
+			else
+				fail [idx] ++;
+		}
+		
+		for (int i = 0; i < pass.Length; i ++)
+			Console.WriteLine ("{0,30}     {1,4}    {2,4}", (UnicodeCategory)
+i, pass [i], fail [i]);
+	}
+	
+	static bool Try (char c)
+	{
+		try {
+			string s = String.Format ("Sat {0}01 Oct 1994 03:00:00", c);
+			DateTime.Parse (s, CultureInfo.InvariantCulture);
+			return true;
+		} catch {
+			return false;
+		}
+	}
+}
+
+
+And got these results:
+
+$ ./x
+               UppercaseLetter        1     685
+               LowercaseLetter        1     803
+               TitlecaseLetter        0      31
+                ModifierLetter        0      46
+                   OtherLetter       10    43866
+                NonSpacingMark      447       0
+          SpacingCombiningMark      118       0
+                 EnclosingMark       10       0
+            DecimalDigitNumber        0     198
+                  LetterNumber       49       0
+                   OtherNumber      184       0
+                SpaceSeparator       17       0
+                 LineSeparator        1       0
+            ParagraphSeparator        1       0
+                       Control       65       0
+                        Format       24       0
+                     Surrogate     2048       0
+                    PrivateUse     6400       0
+          ConnectorPunctuation       11       0
+               DashPunctuation       17       0
+               OpenPunctuation       38       0
+              ClosePunctuation       37       0
+       InitialQuotePunctuation        6       0
+         FinalQuotePunctuation        4       0
+              OtherPunctuation      185       0
+                    MathSymbol      299       0
+                CurrencySymbol       31       0
+                ModifierSymbol       69       0
+                   OtherSymbol     2005       0
+              OtherNotAssigned     7828       0
+


More information about the mono-bugs mailing list