[Mono-bugs] [Bug 398273] New: "Unexpected ISO-2022-JP escape sequence. Ended with 0x004A" in Mono, but not MS .NET

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Jun 7 07:43:14 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=398273


           Summary: "Unexpected ISO-2022-JP escape sequence. Ended with
                    0x004A" in Mono, but not MS .NET
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: x86
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: novellbugzilla at c-hett.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


Created an attachment (id=220870)
 --> (https://bugzilla.novell.com/attachment.cgi?id=220870)
Repro for this exception

Description of Problem:


Steps to reproduce the problem:
1. Create this programm in test.cs:

using System;
using System.Text;

namespace test
{static class Program{[STAThread]static void Main()  {

byte[] b=new
byte[]{0x64,0x6f,0x6e,0x1b,0x24,0x42,0x21,0x47,0x1b,0x28,0x4a,0x74,0x0d,0x0a};
string s=Encoding.GetEncoding("ISO-2022-JP").GetString(b);
Console.WriteLine(s);

}}}

2. Run
c:\Programme\Mono-1.9.1\bin\gmcs test.cs
to compile it

3. Run "test.exe" (with Microsoft.Net Framework, I have all of them installed):

Output:
don't

4. Run test.exe with mono:

C:\Programme\Mono-1.9.1\bin\mono test.exe


Actual Results:

Unhandled Exception: System.ArgumentException: Unexpected ISO-2022-JP escape
sequence. Ended with 0x004A
  at I18N.CJK.ISO2022JPDecoder.GetCharCount (System.Byte[] bytes, Int32 index,
Int32 count) [0x00000]
  at I18N.CJK.ISO2022JPEncoding.GetCharCount (System.Byte[] bytes, Int32 index,
Int32 count) [0x00000]
  at System.Text.Encoding.GetChars (System.Byte[] bytes, Int32 index, Int32
count) [0x00000]
  at System.Text.Encoding.GetString (System.Byte[] bytes, Int32 index, Int32
count) [0x00000]
  at System.Text.Encoding.GetString (System.Byte[] bytes) [0x00000]
  at test.Program.Main () [0x00000]


Expected Results:

don't

How often does this happen? 

ALWAYS, perfectly reproducible

Additional Information:

The bytes above are this:
don’t


We experience this very often while fulltext indexing lots of emails. So even
if this is for any reason a correct behaviour according to some standard, that
wouldn't help anyone and the fact that MS.NET framework can handle it makes it
a real bug in any case.

This pariticular email where this comes from is generated from Outlook 2003 on
our (German!) PCs, when someone replied to a mail from Taiwan.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list