ICU-1864 ucnv_reset() did not reset enough UConverter fields; BOCU-1 signature changed

X-SVN-Rev: 8708
This commit is contained in:
Markus Scherer 2002-05-25 00:32:25 +00:00
parent 6a2c81b056
commit c76aaff480

View file

@ -450,11 +450,13 @@ static void _reset(UConverter *converter, UConverterResetChoice choice) {
/* now reset the converter itself */
if(choice<=UCNV_RESET_TO_UNICODE) {
converter->toUnicodeStatus = converter->sharedData->toUnicodeStatus;
converter->UCharErrorBufferLength = 0;
converter->toULength = 0;
converter->invalidCharLength = converter->UCharErrorBufferLength = 0;
}
if(choice!=UCNV_RESET_TO_UNICODE) {
converter->fromUnicodeStatus = 0;
converter->charErrorBufferLength = 0;
converter->fromUSurrogateLead = 0;
converter->invalidUCharLength = converter->charErrorBufferLength = 0;
}
if (converter->sharedData->impl->reset != NULL) {
@ -1293,7 +1295,7 @@ ucnv_detectUnicodeSignature( const char* source,
} else if(start[0] == '\x0E' && start[1] == '\xFE' && start[2] == '\xFF') {
*signatureLength=3;
return "SCSU";
} else if(start[0] == '\xFC' && start[1] == '\xEE' && start[2] == '\x27') {
} else if(start[0] == '\xFB' && start[1] == '\xEE' && start[2] == '\x28') {
*signatureLength=3;
return "BOCU-1";
} else {