/*
**********************************************************************
-* Copyright (C) 2002-2004, International Business Machines
+* Copyright (C) 2002-2006, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* file name: ucnv_u8.c
{
inBytes = args->converter->mode; /* restore # of bytes to consume */
i = args->converter->toULength; /* restore # of bytes consumed */
+ args->converter->toULength = 0;
ch = args->converter->toUnicodeStatus;/*Stores the previously calculated ch from a previous call*/
args->converter->toUnicodeStatus = 0;
(isCESU8 ? i <= 3 : !UTF_IS_SURROGATE(ch)))
{
/* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */
- args->converter->toULength = 0;
if (ch <= MAXIMUM_UCS2)
{
/* fits in 16 bits */
{
inBytes = args->converter->mode; /* restore # of bytes to consume */
i = args->converter->toULength; /* restore # of bytes consumed */
+ args->converter->toULength = 0;
ch = args->converter->toUnicodeStatus;/*Stores the previously calculated ch from a previous call*/
args->converter->toUnicodeStatus = 0;
(isCESU8 ? i <= 3 : !UTF_IS_SURROGATE(ch)))
{
/* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */
- args->converter->toULength = 0;
if (ch <= MAXIMUM_UCS2)
{
/* fits in 16 bits */
const UChar *sourceLimit = args->sourceLimit;
const unsigned char *targetLimit = (unsigned char *) args->targetLimit;
UBool isCESU8 = (UBool)(args->converter->sharedData == &_CESU8Data);
- UChar32 ch, ch2;
+ UChar32 ch;
int16_t indexToWrite;
char temp[4];
if(UTF_IS_SECOND_SURROGATE(trail)) {
++mySource;
ch=UTF16_GET_PAIR_VALUE(ch, trail);
- ch2 = 0;
/* convert this supplementary code point */
/* exit this condition tree */
} else {
const UChar *sourceLimit = args->sourceLimit;
const unsigned char *targetLimit = (unsigned char *) args->targetLimit;
UBool isCESU8 = (UBool)(args->converter->sharedData == &_CESU8Data);
- UChar32 ch, ch2;
+ UChar32 ch;
int32_t offsetNum, nextSourceIndex;
int16_t indexToWrite;
char temp[4];
++mySource;
++nextSourceIndex;
ch=UTF16_GET_PAIR_VALUE(ch, trail);
- ch2 = 0;
/* convert this supplementary code point */
/* exit this condition tree */
} else {
static const UConverterStaticData _CESU8StaticData={
sizeof(UConverterStaticData),
"CESU-8",
- 0, UCNV_UNKNOWN, UCNV_CESU8, 1, 3,
+ 9400, /* CCSID for CESU-8 */
+ UCNV_UNKNOWN, UCNV_CESU8, 1, 3,
{ 0xef, 0xbf, 0xbd, 0 },3,FALSE,FALSE,
0,
0,