ICU-5171 fix iso-2022-cn min bytes per char: 1 not 2

X-SVN-Rev: 19735
This commit is contained in:
Markus Scherer 2006-06-16 21:54:08 +00:00
parent 48633f914b
commit 8f9047d4ac
2 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (C) 2000-2005, International Business Machines
* Copyright (C) 2000-2006, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* file name: ucnv2022.c
@ -3288,7 +3288,7 @@ static const UConverterStaticData _ISO2022CNStaticData={
0,
UCNV_IBM,
UCNV_ISO_2022,
2,
1,
8, /* max 8 bytes per UChar: 4-byte CNS designator + 2 bytes for SS2/SS3 + DBCS */
{ 0x1a, 0, 0, 0 },
1,

View File

@ -445,6 +445,14 @@ conversion:table(nofallback) {
fromUnicode {
Headers { "charset", "unicode", "bytes", "offsets", "flush", "fallbacks", "errorCode", "callback", "invalidUChars" }
Cases {
// ISO 2022-CN: test a single-byte subchar, j5171
{
"iso-2022-cn",
"a\x1bc", // Unicode ESC must not occur as a character
:bin{ 612163 },
:intvector{ 0,1,2 },
:int{1}, :int{0}, "", "?\x00\x21", ""
}
// UTF-16/32: do not output a BOM if there is no data at all
{
"UTF-16",