2 * fribidi-char-sets-iso8859-8.c - ISO8859-8 character set conversion routines
5 * Behdad Esfahbod, 2001, 2002, 2004
6 * Dov Grobgeld, 1999, 2000
8 * Copyright (C) 2004 Sharif FarsiWeb, Inc
9 * Copyright (C) 2001,2002 Behdad Esfahbod
10 * Copyright (C) 1999,2000 Dov Grobgeld
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this library, in a file named COPYING; if not, write to the
24 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301, USA
27 * For licensing issues, contact <fribidi.license@gmail.com>.
32 #include <fribidi-char-sets-iso8859-8.h>
34 #include <fribidi-unicode.h>
36 /* The following are proposed extensions to ISO8859-8. */
37 #define ISO_8859_8_LRM 0xFD
38 #define ISO_8859_8_RLM 0xFE
39 #define ISO_8859_8_LRE 0xFB
40 #define ISO_8859_8_RLE 0xFC
41 #define ISO_8859_8_PDF 0xDD
42 #define ISO_8859_8_LRO 0xDB
43 #define ISO_8859_8_RLO 0xDC
47 #define UNI_ALEF 0x05D0
48 #define UNI_TAV 0x05EA
51 fribidi_iso8859_8_to_unicode_c (
56 register unsigned char ch = (unsigned char) sch;
57 if (ch < ISO_8859_8_LRO)
59 else if (ch >= ISO_ALEF && ch <= ISO_TAV)
60 return ch - ISO_ALEF + UNI_ALEF;
64 return FRIBIDI_CHAR_RLM;
66 return FRIBIDI_CHAR_LRM;
68 return FRIBIDI_CHAR_RLO;
70 return FRIBIDI_CHAR_LRO;
72 return FRIBIDI_CHAR_RLE;
74 return FRIBIDI_CHAR_LRE;
76 return FRIBIDI_CHAR_PDF;
83 fribidi_unicode_to_iso8859_8_c (
90 if (uch >= UNI_ALEF && uch <= UNI_TAV)
91 return (char) (uch - UNI_ALEF + ISO_ALEF);
94 case FRIBIDI_CHAR_RLM:
95 return (char) ISO_8859_8_RLM;
96 case FRIBIDI_CHAR_LRM:
97 return (char) ISO_8859_8_LRM;
98 case FRIBIDI_CHAR_RLO:
99 return (char) ISO_8859_8_RLO;
100 case FRIBIDI_CHAR_LRO:
101 return (char) ISO_8859_8_LRO;
102 case FRIBIDI_CHAR_RLE:
103 return (char) ISO_8859_8_RLE;
104 case FRIBIDI_CHAR_LRE:
105 return (char) ISO_8859_8_LRE;
106 case FRIBIDI_CHAR_PDF:
107 return (char) ISO_8859_8_PDF;
112 /* Editor directions:
113 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent