-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.3.0
-
generic
-
generic
CharToByteISO8859_1.convert() should increment charOff if a high surrogate is the last character in the input array before doing the break. So the next convert() can process the remaining characters correctly.
I attached a test. In this test case, the input array is {'a', 'b', 'c', 'd', 'e', '\uD800', '\uDC00', 'f', 'g', 'h'}. First it converts from 0 to 6 (the location of the high surrogate), then converts from nextCharIndex() (the location of the low surrogate) to the end. The second conversion throws MalformedInputException with the message:
"Previous converted string ends with <High Half Zone Code> of UTF16 , but this string is not begin with <Low Half Zone>"
The exception shouldn't happen, since it's a legal UTF16 sequence. Increment charOff before the break will fix the problem.
jiangli.zhou@eng 2001-05-22
I attached a test. In this test case, the input array is {'a', 'b', 'c', 'd', 'e', '\uD800', '\uDC00', 'f', 'g', 'h'}. First it converts from 0 to 6 (the location of the high surrogate), then converts from nextCharIndex() (the location of the low surrogate) to the end. The second conversion throws MalformedInputException with the message:
"Previous converted string ends with <High Half Zone Code> of UTF16 , but this string is not begin with <Low Half Zone>"
The exception shouldn't happen, since it's a legal UTF16 sequence. Increment charOff before the break will fix the problem.
jiangli.zhou@eng 2001-05-22