1 |
pva 10/01/05 07:13:54 |
2 |
|
3 |
Added: gettext-0.17-x-python.patch |
4 |
Log: |
5 |
Backport upstream fix: replace a lone high surrogate with U+FFFD, bug #299658. Required for gajim test suite to pass. |
6 |
(Portage version: 2.1.7.16/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 sys-devel/gettext/files/gettext-0.17-x-python.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/gettext/files/gettext-0.17-x-python.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/gettext/files/gettext-0.17-x-python.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: gettext-0.17-x-python.patch |
15 |
=================================================================== |
16 |
From a6fed64abcc079877b33804420c666b867b50987 Mon Sep 17 00:00:00 2001 |
17 |
From: Bruno Haible <bruno@×××××.org> |
18 |
Date: Sun, 03 Aug 2008 20:00:25 +0000 |
19 |
Subject: Handle lone high surrogates gracefully. |
20 |
|
21 |
2008-08-03 Bruno Haible <bruno@×××××.org> |
22 |
|
23 |
* x-python.c (mixed_string_buffer_append): Replace a lone high |
24 |
surrogate with U+FFFD. |
25 |
Reported by Yann <asterix@×××××××.org> |
26 |
via Santiago Vila <sanvila@××××.es>. |
27 |
|
28 |
diff --git a/gettext-tools/src/x-python.c b/gettext-tools/src/x-python.c |
29 |
index e6dcc31..e05aca4 100644 |
30 |
--- a/gettext-tools/src/x-python.c |
31 |
+++ b/gettext-tools/src/x-python.c |
32 |
@@ -930,6 +930,11 @@ mixed_string_buffer_append (struct mixed_string_buffer *bp, int c) |
33 |
|
34 |
if (c >= UNICODE (0xd800) && c < UNICODE (0xdc00)) |
35 |
bp->utf16_surr = UNICODE_VALUE (c); |
36 |
+ else if (c >= UNICODE (0xdc00) && c < UNICODE (0xe000)) |
37 |
+ { |
38 |
+ /* A half surrogate is invalid, therefore use U+FFFD instead. */ |
39 |
+ mixed_string_buffer_append_unicode (bp, 0xfffd); |
40 |
+ } |
41 |
else |
42 |
mixed_string_buffer_append_unicode (bp, UNICODE_VALUE (c)); |
43 |
} |