1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: convertiscii.tab,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 #include "rtl/tencinfo.h"
34 #include "sal/types.h"
38 /* Conversion tables for the Devanagari version of ISCII (IS 13194:1991).
40 * They do not map the ISCII characters INV (0xD9), ATR (0xEF), and EXT (0xF0).
41 * They do not map U+0958--095E to sequences of two ISCII characters, of which
42 * the second would be the combining nukta (0xE9).
45 /* The following table is based on LGPL code by Sandeep Patnaik
46 * (patnaik@students.iiit.net) and Sunil Mohan Adapa
47 * (sunilmohanadapa@postmark.net).
49 #define RTL_TEXTENC_ISCII_DEVANAGARI_START 0xA1
50 #define RTL_TEXTENC_ISCII_DEVANAGARI_END 0xFA
51 static sal_uInt16 const
52 aImplIsciiDevanagariToUniTab[RTL_TEXTENC_ISCII_DEVANAGARI_END
53 - RTL_TEXTENC_ISCII_DEVANAGARI_START + 1]
54 = { 0x0901, 0x0902, 0x0903, 0x0905, 0x0906, 0x0907, 0x0908, /* A0 */
55 0x0909, 0x090A, 0x090B, 0x090E, 0x090F, 0x0910, 0x090D, 0x0912,
56 0x0913, 0x0914, 0x0911, 0x0915, 0x0916, 0x0917, 0x0918, 0x0919, /* B0 */
57 0x091A, 0x091B, 0x091C, 0x091D, 0x091E, 0x091F, 0x0920, 0x0921,
58 0x0922, 0x0923, 0x0924, 0x0925, 0x0926, 0x0927, 0x0928, 0x0929, /* C0 */
59 0x092A, 0x092B, 0x092C, 0x092D, 0x092E, 0x092F, 0x095F, 0x0930,
60 0x0931, 0x0932, 0x0933, 0x0934, 0x0935, 0x0936, 0x0937, 0x0938, /* D0 */
61 0x0939, 0, 0x093E, 0x093F, 0x0940, 0x0941, 0x0942, 0x0943,
62 0x0946, 0x0947, 0x0948, 0x0945, 0x094A, 0x094B, 0x094C, 0x0949, /* E0 */
63 0x094D, 0x093C, 0x0964, 0, 0, 0, 0, 0,
64 0, 0x0966, 0x0967, 0x0968, 0x0969, 0x096A, 0x096B, 0x096C, /* F0 */
65 0x096D, 0x096E, 0x096F };
67 #define RTL_TEXTENC_UNICODE_DEVANAGARI_START 0x0901
68 #define RTL_TEXTENC_UNICODE_DEVANAGARI_END 0x096F
69 static sal_uChar const
70 aImplUniToIsciiDevanagariTab[RTL_TEXTENC_UNICODE_DEVANAGARI_END
71 - RTL_TEXTENC_UNICODE_DEVANAGARI_START + 1]
72 = { 0xA1, 0xA2, 0xA3, 0, 0xA4, 0xA5, 0xA6, /* U+0900 */
73 0xA7, 0xA8, 0xA9, 0xAA, 0, 0xAE, 0xAB, 0xAC,
74 0xAD, 0xB2, 0xAF, 0xB0, 0xB1, 0xB3, 0xB4, 0xB5, /* U+0910 */
75 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD,
76 0xBE, 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, /* U+0920 */
77 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD,
78 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, /* U+0930 */
79 0xD7, 0xD8, 0, 0, 0xE9, 0, 0xDA, 0xDB,
80 0xDC, 0xDD, 0xDE, 0xDF, 0, 0xE3, 0xE0, 0xE1, /* U+0940 */
81 0xE2, 0xE7, 0xE4, 0xE5, 0xE6, 0xE8, 0, 0,
82 0, 0, 0, 0, 0, 0, 0, 0, /* U+0950 */
83 0, 0, 0, 0, 0, 0, 0, 0xCE,
84 0, 0, 0, 0, 0xEA, 0, 0xF1, 0xF2, /* U+0960 */
85 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA };
87 static ImplByteConvertData const aImplIsciiDevanagariConvertData
88 = { aImplIsciiDevanagariToUniTab,
90 RTL_TEXTENC_ISCII_DEVANAGARI_START, RTL_TEXTENC_ISCII_DEVANAGARI_END,
91 NOTABUNI_START, NOTABUNI_END,
92 aImplUniToIsciiDevanagariTab,
95 RTL_TEXTENC_UNICODE_DEVANAGARI_START, RTL_TEXTENC_UNICODE_DEVANAGARI_END,
96 NOTABCHAR_START, NOTABCHAR_END,
99 static ImplTextEncodingData const aImplIsciiDevanagariTextEncodingData
100 = { { &aImplIsciiDevanagariConvertData,
115 RTL_TEXTENCODING_INFO_ASCII };