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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=77274 --- shadow/77274 2006-01-16 08:37:32.000000000 -0500 +++ shadow/77274.tmp.11838 2006-01-16 12:07:13.000000000 -0500 @@ -5,19 +5,19 @@ OS Details: Status: NEW Resolution: Severity: Unknown Priority: Normal Component: CORLIB -AssignedTo: [EMAIL PROTECTED] +AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] QAContact: [EMAIL PROTECTED] TargetMilestone: --- URL: Cc: -Summary: bug in CP950 encoding - GetChars method +Summary: bug in CP950 encoding - GetChars raises IndexOutOfRangeException unexpectedly Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: The CP950 encoding converter throws exceptions where it shouldn't. @@ -54,6 +54,57 @@ Source code see attachment. ------- Additional Comments From [EMAIL PROTECTED] 2006-01-16 08:37 ------- Created an attachment (id=16354) monobug.cs + +------- Additional Comments From [EMAIL PROTECTED] 2006-01-16 12:07 ------- +Good repro code to find out where the exception orrus: + +using System; /* String, Console */ +using System.Text; /* Encoding */ + +public class monobug { + public static int Main (String[] args) { + try { + Encoding encoding = Encoding.GetEncoding(950); + for (int i0 = 0; i0 < 0x100; i0++) { + for (int i1 = 0; i1 < 0x100; i1++) { + Console.WriteLine ("{0:X02} {1:X02}", i0, i1); + encoding.GetChars(new byte[] { (byte)i0, (byte)i1 }); + } + } + } catch (Exception e) { + Console.Error.WriteLine(e); + Console.Error.WriteLine(e.StackTrace); + return 1; + } + return 0; + } +} + +Actual result: + +... +(snip) +... +A0 FF +A1 00 +System.IndexOutOfRangeException: Array index is out of range. +in <0x00124> I18N.CJK.CP950:GetChars (System.Byte[] bytes, Int32 +byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex) +in <0x00072> I18N.CJK.DbcsEncoding:GetCharCount (System.Byte[] bytes, +Int32 index, Int32 count) +in <0x00027> System.Text.Encoding:GetChars (System.Byte[] bytes) +in <0x000d7> monobug:Main (System.String[] args) +in <0x00124> I18N.CJK.CP950:GetChars (System.Byte[] bytes, Int32 +byteIndex, Int32 byteCount, System.Char[] chars, Int32 charIndex) +in <0x00072> I18N.CJK.DbcsEncoding:GetCharCount (System.Byte[] bytes, +Int32 index, Int32 count) +in <0x00027> System.Text.Encoding:GetChars (System.Byte[] bytes) +in <0x000d7> monobug:Main (System.String[] args) + +Expected result: + +no error. + _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
