gettext/gettext-xgettext-python-unicode-surrogate-473946.patch
Jens Petersen ff88f624b3 - add buildjava switch to allow turning off the java bits completely
- add buildcheck to allow turning off make check
- drop cvs requires for autopoint (Karl Lattimer, #469555)
- add upstream gettext-xgettext-python-unicode-surrogate-473946.patch by
    Bruno Haible to fix xgettext handling of utf16 surrogates in python
    (#473946)
2009-02-12 06:40:02 +00:00

24 lines
782 B
Diff

2008-08-03 Bruno Haible <bruno@clisp.org>
* x-python.c (mixed_string_buffer_append): Replace a lone high
surrogate with U+FFFD.
Reported by Yann <asterix@lagaule.org>
via Santiago Vila <sanvila@unex.es>.
*** gettext-tools/src/x-python.c 20 Apr 2008 05:23:52 -0000 1.32
--- gettext-tools/src/x-python.c 3 Aug 2008 19:56:58 -0000
***************
*** 930,935 ****
--- 930,940 ----
if (c >= UNICODE (0xd800) && c < UNICODE (0xdc00))
bp->utf16_surr = UNICODE_VALUE (c);
+ else if (c >= UNICODE (0xdc00) && c < UNICODE (0xe000))
+ {
+ /* A half surrogate is invalid, therefore use U+FFFD instead. */
+ mixed_string_buffer_append_unicode (bp, 0xfffd);
+ }
else
mixed_string_buffer_append_unicode (bp, UNICODE_VALUE (c));
}