+2003-09-11 Bruno Haible <bruno@clisp.org>
+
+ * po-lex.c (mbfile_getc): Ignore the return value of u8_mbtouc().
+ Reported by Jochen Hein <jochen@jochen.org>.
+
2003-09-09 Bruno Haible <bruno@clisp.org>
* read-properties.c (phase4_getuc): Cast line_number to 'unsigned long'
abort ();
/* Convert it from UTF-8 to UCS-4. */
mbc->uc_valid = true;
- if (u8_mbtouc (&mbc->uc, scratchbuf, outbytes) != outbytes)
- abort ();
+ /* We ignore the return value of u8_mbtouc(): Usually it returns
+ outbytes, but if scratchbuf contains an out-of-range Unicode
+ character (> 0x10ffff), it can also return 1 and set mbc->uc
+ to 0xfffd. This is precisely what we need. */
+ u8_mbtouc (&mbc->uc, scratchbuf, outbytes);
break;
}
}