From: behdad Date: Tue, 22 Apr 2008 19:50:46 +0000 (+0000) Subject: Handle RLM/LRM in CP1255 charset converter. (#15328, Artyom) X-Git-Tag: 0.19.4~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d60a4546004df012871348b00be28f57baca28a8;p=fribidi Handle RLM/LRM in CP1255 charset converter. (#15328, Artyom) --- diff --git a/charset/fribidi-char-sets-cp1255.c b/charset/fribidi-char-sets-cp1255.c index 3dc19c9..8d339ed 100644 --- a/charset/fribidi-char-sets-cp1255.c +++ b/charset/fribidi-char-sets-cp1255.c @@ -1,10 +1,10 @@ /* FriBidi * fribidi-char-sets-cp1255.c - CP1255 character set conversion routines * - * $Id: fribidi-char-sets-cp1255.c,v 1.2 2004-05-03 22:05:19 behdad Exp $ + * $Id: fribidi-char-sets-cp1255.c,v 1.3 2008-04-22 19:50:46 behdad Exp $ * $Author: behdad $ - * $Date: 2004-05-03 22:05:19 $ - * $Revision: 1.2 $ + * $Date: 2008-04-22 19:50:46 $ + * $Revision: 1.3 $ * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/charset/fribidi-char-sets-cp1255.c,v $ * * Authors: @@ -43,6 +43,8 @@ #define CP1255_SOF_PASUQ 0xD3 #define CP1255_DOUBLE_VAV 0xD4 #define CP1255_GERSHAYIM 0xD8 +#define CP1255_LRM 0xFD +#define CP1255_RLM 0xFE #define UNI_ALEF 0x05D0 #define UNI_TAV 0x05EA @@ -50,6 +52,8 @@ #define UNI_SOF_PASUQ 0x05C3 #define UNI_DOUBLE_VAV 0x05F0 #define UNI_GERSHAYIM 0x05F4 +#define UNI_LRM 0x200E +#define UNI_RLM 0x200F static FriBidiChar fribidi_cp1255_to_unicode_tab[] = { /* 0x80-0xBF */ 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, @@ -78,7 +82,10 @@ fribidi_cp1255_to_unicode_c ( /* 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; } @@ -95,6 +102,9 @@ fribidi_unicode_to_cp1255_c ( 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