fixed a bug in the ISO-Latin 1 to UTF8 encoder raised by Morus Walter

* encoding.c: fixed a bug in the ISO-Latin 1 to UTF8 encoder
  raised by Morus Walter
Daniel
This commit is contained in:
Daniel Veillard 2002-03-21 13:27:59 +00:00
parent 9e537937a6
commit db5529150b
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Thu Mar 21 14:25:29 CET 2002 Daniel Veillard <daniel@veillard.com>
* encoding.c: fixed a bug in the ISO-Latin 1 to UTF8 encoder
raised by Morus Walter
Thu Mar 21 14:07:13 CET 2002 Daniel Veillard <daniel@veillard.com>
* xmlcatalog.c include/libxml/xmlversion.h.in: applied 2 fixups

View File

@ -577,9 +577,13 @@ isolat1ToUTF8(unsigned char* out, int *outlen,
processed++;
continue;
} else {
*out++= ((c >> 6) & 0x1F) | 0xC0;
if (out >= outend)
/*
* make sure there is 2 chars left in advance
*/
if (out + 1 >= outend) {
break;
}
*out++= ((c >> 6) & 0x1F) | 0xC0;
*out++= (c & 0x3F) | 0x80;
processed++;
}