[Mono-bugs] [Bug 38984][Nor] New - Encoding.ASCII.GetChars() fails on 0x80

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 3 Mar 2003 10:38:26 -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 ndrochak@gol.com.

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

--- shadow/38984	Mon Mar  3 10:38:26 2003
+++ shadow/38984.tmp.8294	Mon Mar  3 10:38:26 2003
@@ -0,0 +1,45 @@
+Bug#: 38984
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 8.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ndrochak@gol.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Encoding.ASCII.GetChars() fails on 0x80
+
+Sample test program should return 0, like it does on .NET, but it returns 1
+on current mono cvs:
+
+using System;
+using System.Text;
+
+namespace N {
+	public class C {
+		static private byte[] testbytes;
+		
+		public static int Main () {
+			testbytes = new byte[4];
+			testbytes[0] = (byte) 'T';
+			testbytes[1] = (byte) 'e';
+			testbytes[2] = (byte) 's';
+			testbytes[3] = (byte) 't';
+			
+			Encoding ascii_encoding = Encoding.ASCII;
+			testbytes[2] = 0x80;
+			char[] chars = ascii_encoding.GetChars(testbytes);
+			if ('?' == chars[2])
+				return 0;
+			else
+				return 1;
+		}
+	}
+}