1/* FriBidi
2 * fribidi-char-sets-iso8859-6.c - ISO8859-6 character set conversion routines
3 *
4 * Authors:
5 * Behdad Esfahbod, 2001, 2002, 2004
6 * Dov Grobgeld, 1999, 2000
7 *
8 * Copyright (C) 2004 Sharif FarsiWeb, Inc
9 * Copyright (C) 2001,2002 Behdad Esfahbod
10 * Copyright (C) 1999,2000 Dov Grobgeld
11 *
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.
16 *
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.
21 *
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
26 *
27 * For licensing issues, contact <fribidi.license@gmail.com>.
28 */
29
30#include <common.h>
31
32#include <fribidi-char-sets-iso8859-6.h>
33
34#define ISO_HAMZA 0xc1
35#define ISO_SUKUN 0xf2
36
37#define UNI_HAMZA 0x0621
38#define UNI_SUKUN 0x0652
39
40FriBidiChar
41fribidi_iso8859_6_to_unicode_c (
42 /* input */
43 char sch
44)
45{
46 register unsigned char ch = (unsigned char) sch;
47 if (ch >= ISO_HAMZA && ch <= ISO_SUKUN)
48 return ch - ISO_HAMZA + UNI_HAMZA;
49 else
50 return ch;
51}
52
53char
54fribidi_unicode_to_iso8859_6_c (
55 /* input */
56 FriBidiChar uch
57)
58{
59 if (uch >= UNI_HAMZA && uch <= UNI_SUKUN)
60 return (char) (uch - UNI_HAMZA + ISO_HAMZA);
61 else if (uch < 256)
62 return (char) uch;
63 else if (uch == 0x060c)
64 return (char) 0xac;
65 else if (uch == 0x061b)
66 return (char) 0xbb;
67 else if (uch == 0x061f)
68 return (char) 0xbf;
69 else
70 return '?';
71}
72
73/* Editor directions:
74 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent
75 */
76

source code of gtk/subprojects/fribidi/lib/fribidi-char-sets-iso8859-6.c