uint32_t ch, i;
/* Restore state of current sequence */
- if (args->converter->toUnicodeStatus && myTarget < targetLimit) {
+ if (args->converter->toULength > 0 && myTarget < targetLimit) {
i = args->converter->toULength; /* restore # of bytes consumed */
args->converter->toULength = 0;
int32_t offsetNum = 0;
/* Restore state of current sequence */
- if (args->converter->toUnicodeStatus && myTarget < targetLimit) {
+ if (args->converter->toULength > 0 && myTarget < targetLimit) {
i = args->converter->toULength; /* restore # of bytes consumed */
args->converter->toULength = 0;
/* write the BOM if necessary */
if(args->converter->fromUnicodeStatus==UCNV_NEED_TO_WRITE_BOM) {
- static const char bom[]={ 0, 0, (char)0xfe, (char)0xff };
+ static const char bom[]={ 0, 0, (char)0xfeu, (char)0xffu };
ucnv_fromUWriteBytes(args->converter,
bom, 4,
&args->target, args->targetLimit,
/* write the BOM if necessary */
if(args->converter->fromUnicodeStatus==UCNV_NEED_TO_WRITE_BOM) {
- static const char bom[]={ 0, 0, (char)0xfe, (char)0xff };
+ static const char bom[]={ 0, 0, (char)0xfeu, (char)0xffu };
ucnv_fromUWriteBytes(args->converter,
bom, 4,
&args->target, args->targetLimit,
uint32_t ch, i;
/* Restore state of current sequence */
- if (args->converter->toUnicodeStatus && myTarget < targetLimit)
+ if (args->converter->toULength > 0 && myTarget < targetLimit)
{
i = args->converter->toULength; /* restore # of bytes consumed */
args->converter->toULength = 0;
int32_t offsetNum = 0;
/* Restore state of current sequence */
- if (args->converter->toUnicodeStatus && myTarget < targetLimit)
+ if (args->converter->toULength > 0 && myTarget < targetLimit)
{
i = args->converter->toULength; /* restore # of bytes consumed */
args->converter->toULength = 0;
/* write the BOM if necessary */
if(args->converter->fromUnicodeStatus==UCNV_NEED_TO_WRITE_BOM) {
- static const char bom[]={ (char)0xff, (char)0xfe, 0, 0 };
+ static const char bom[]={ (char)0xffu, (char)0xfeu, 0, 0 };
ucnv_fromUWriteBytes(args->converter,
bom, 4,
&args->target, args->targetLimit,
/* write the BOM if necessary */
if(args->converter->fromUnicodeStatus==UCNV_NEED_TO_WRITE_BOM) {
- static const char bom[]={ (char)0xff, (char)0xfe, 0, 0 };
+ static const char bom[]={ (char)0xffu, (char)0xfeu, 0, 0 };
ucnv_fromUWriteBytes(args->converter,
bom, 4,
&args->target, args->targetLimit,
_UTF32Reset(cnv, UCNV_RESET_BOTH);
}
-static const char utf32BOM[8]={ 0, 0, (char)0xfe, (char)0xff, (char)0xff, (char)0xfe, 0, 0 };
+static const char utf32BOM[8]={ 0, 0, (char)0xfeu, (char)0xffu, (char)0xffu, (char)0xfeu, 0, 0 };
static void U_CALLCONV
_UTF32ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
b=*source;
if(b==0) {
state=1; /* could be 00 00 FE FF */
- } else if(b==(char)0xff) {
+ } else if(b==(char)0xffu) {
state=5; /* could be FF FE 00 00 */
} else {
state=8; /* default to UTF-32BE */