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