ICU-6300 Set the max bytes per char for UTF16 to 4 to make it consistent with the specs.

X-SVN-Rev: 24105
This commit is contained in:
Michael Ow 2008-06-04 17:49:37 +00:00
parent fc6eab0cd7
commit e337ab8678
3 changed files with 7 additions and 7 deletions

View file

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (C) 2002-2006, International Business Machines
* Copyright (C) 2002-2008, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* file name: ucnv_u16.c
@ -574,7 +574,7 @@ static const UConverterImpl _UTF16BEImpl={
static const UConverterStaticData _UTF16BEStaticData={
sizeof(UConverterStaticData),
"UTF-16BE",
1200, UCNV_IBM, UCNV_UTF16_BigEndian, 2, 2,
1200, UCNV_IBM, UCNV_UTF16_BigEndian, 2, 4,
{ 0xff, 0xfd, 0, 0 },2,FALSE,FALSE,
0,
0,
@ -1129,7 +1129,7 @@ static const UConverterImpl _UTF16LEImpl={
static const UConverterStaticData _UTF16LEStaticData={
sizeof(UConverterStaticData),
"UTF-16LE",
1202, UCNV_IBM, UCNV_UTF16_LittleEndian, 2, 2,
1202, UCNV_IBM, UCNV_UTF16_LittleEndian, 2, 4,
{ 0xfd, 0xff, 0, 0 },2,FALSE,FALSE,
0,
0,
@ -1351,7 +1351,7 @@ static const UConverterStaticData _UTF16StaticData = {
sizeof(UConverterStaticData),
"UTF-16",
1204, /* CCSID for BOM sensitive UTF-16 */
UCNV_IBM, UCNV_UTF16, 2, 2,
UCNV_IBM, UCNV_UTF16, 2, 4,
#if U_IS_BIG_ENDIAN
{ 0xff, 0xfd, 0, 0 }, 2,
#else

View file

@ -2808,8 +2808,8 @@ static void TestLMBCSMaxChar(void) {
{ 1, "US-ASCII"},
{ 1, "ISO-8859-1"},
{ 2, "UTF-16"},
{ 2, "UTF-16BE"},
{ 4, "UTF-16"},
{ 4, "UTF-16BE"},
{ 3, "UTF-8"},
{ 3, "CESU-8"},
{ 3, "SCSU"},

View file

@ -52,7 +52,7 @@ class CharsetUTF16 extends CharsetICU {
this.endianXOR = ENDIAN_XOR_LE;
}
maxBytesPerChar = 2;
maxBytesPerChar = 4;
minBytesPerChar = 2;
maxCharsPerByte = 1;
}