From 5c162c2076ad4ca9132bf29d62c2ebec3ce5053d Mon Sep 17 00:00:00 2001 From: behdad Date: Tue, 22 Apr 2008 06:12:31 +0000 Subject: 2008-04-22 Behdad Esfahbod MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bugzilla – Bug 15328 LRM/MLR marks not converted between cp1255 and UNICODE Patch from Artyom * fribidi_char_sets_cp1255.c (fribidi_cp1255_to_unicode_c), (fribidi_unicode_to_cp1255_c): Handle LRM/RLM in CP1255. --- ChangeLog | 9 +++++++++ fribidi_char_sets_cp1255.c | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f31aa14..1e53096 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-04-22 Behdad Esfahbod + + Bugzilla – Bug 15328 + LRM/MLR marks not converted between cp1255 and UNICODE + Patch from Artyom + + * fribidi_char_sets_cp1255.c (fribidi_cp1255_to_unicode_c), + (fribidi_unicode_to_cp1255_c): Handle LRM/RLM in CP1255. + 2008-04-08 Behdad Esfahbod Update tables to Unicode Character Database 5.1.0. diff --git a/fribidi_char_sets_cp1255.c b/fribidi_char_sets_cp1255.c index 57b8d55..eaa3918 100644 --- a/fribidi_char_sets_cp1255.c +++ b/fribidi_char_sets_cp1255.c @@ -33,6 +33,9 @@ #define CP1255_SOF_PASUQ 0xD3 #define CP1255_DOUBLE_VAV 0xD4 #define CP1255_GERSHAYIM 0xD8 +#define CP1255_LRM 253 +#define CP1255_RLM 254 + #define UNI_ALEF 0x05D0 #define UNI_TAV 0x05EA @@ -40,6 +43,8 @@ #define UNI_SOF_PASUQ 0x05C3 #define UNI_DOUBLE_VAV 0x05F0 #define UNI_GERSHAYIM 0x05F4 +#define UNI_LRM 0x200E +#define UNI_RLM 0x200F FriBidiChar fribidi_cp1255_to_unicode_tab[] = { /* 0x80-0xBF */ 0x20AC, 0x81, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, @@ -65,7 +70,10 @@ fribidi_cp1255_to_unicode_c (char sch) /* cp1256 specific chars */ else if (ch >= 0x80 && ch <= 0xbf) return fribidi_cp1255_to_unicode_tab[ch - 0x80]; - else + else if (ch == CP1255_LRM || ch == CP1255_RLM) + return ch - CP1255_LRM + UNI_LRM; + /* treat LRM/LRM charrectes correctly */ + else return ch; } @@ -90,6 +98,9 @@ fribidi_unicode_to_cp1255_c (FriBidiChar uch) if (uch >= UNI_DOUBLE_VAV && uch <= UNI_GERSHAYIM) return (char) (uch - UNI_DOUBLE_VAV + CP1255_DOUBLE_VAV); /* TODO: handle pre-composed and presentation chars */ + if (uch == UNI_LRM || uch==UNI_RLM) + return (char) (uch - UNI_LRM + CP1255_LRM); + /* Treat LRM/RLM charrecters correctly */ else if (uch < 256) return (char) uch; else -- cgit v1.2.3