[Mono-bugs] [Bug 54939][Min] Changed - Convert.FromBase64String doesn't accept NL and LF in the string

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 10 Mar 2004 09:36:11 -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 spouliot@videotron.ca.

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

--- shadow/54939	2004-02-27 14:35:42.000000000 -0500
+++ shadow/54939.tmp.19024	2004-03-10 09:36:11.000000000 -0500
@@ -1,12 +1,12 @@
 Bug#: 54939
-Product: Mono/Class Libraries
+Product: Mono: Class Libraries
 Version: unspecified
 OS: All
 OS Details: 
-Status: NEW   
+Status: ASSIGNED   
 Resolution: 
 Severity: Unknown
 Priority: Minor
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: spouliot@videotron.ca               
@@ -50,6 +50,61 @@
 Created an attachment (id=6789)
 base64withNL.cs
 
 
 ------- Additional Comments From spouliot@videotron.ca  2004-02-27 14:35 -------
 added (late ;-) attachement and a new unit test (in CVS)
+
+------- Additional Comments From spouliot@videotron.ca  2004-03-10 09:36 -------
+A small loop from 0 to 255 shows that MS accept 9, 10, 13 and 32 
+anywhere in a base64 string, i.e. before, inside or after the base64 
+encoded data. Note that there may be other special case.
+
+// before
+Console.WriteLine ("Before");
+for (int i=0; i < 256; i++) {
+	base64 = ((char)i) + s;
+	try {
+		doubledata = Convert.FromBase64String (base64);
+		Console.WriteLine (i);
+	}
+	catch {}
+}
+// in
+Console.WriteLine ("Inside");
+for (int i=0; i < 256; i++) {
+	base64 = s + ((char)i) + s;
+	try {
+		doubledata = Convert.FromBase64String (base64);
+		Console.WriteLine (i);
+	}
+	catch {}
+}
+// after
+Console.WriteLine ("After");
+for (int i=0; i < 256; i++) {
+	base64 = ((char)i) + s;
+	try {
+		doubledata = Convert.FromBase64String (base64);
+		Console.WriteLine (i);
+	}
+	catch {}
+}
+
+
+Results:
+Before
+9
+10
+13
+32
+Inside
+9
+10
+13
+32
+After
+9
+10
+13
+32
+