/************************************************************************* * * $RCSfile: convertiscii.tab,v $ * * $Revision: 1.2 $ * * last change: $Author: vg $ $Date: 2003-06-20 10:11:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses * * - GNU Lesser General Public License Version 2.1 * - Sun Industry Standards Source License Version 1.1 * * Sun Microsystems Inc., October, 2000 * * GNU Lesser General Public License Version 2.1 * ============================================= * Copyright 2000 by Sun Microsystems, Inc. * 901 San Antonio Road, Palo Alto, CA 94303, USA * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * * Sun Industry Standards Source License Version 1.1 * ================================================= * The contents of this file are subject to the Sun Industry Standards * Source License Version 1.1 (the "License"); You may not use this file * except in compliance with the License. You may obtain a copy of the * License at http://www.openoffice.org/license.html. * * Software provided under this License is provided on an "AS IS" basis, * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS, * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. * See the License for the specific provisions governing your rights and * obligations concerning the Software. * * The Initial Developer of the Original Code is: Sun Microsystems, Inc.. * * Copyright: 2000 by Sun Microsystems, Inc. * * All Rights Reserved. * * Contributor(s): _______________________________________ * * ************************************************************************/ #include "tenchelp.h" #include "rtl/tencinfo.h" #include "sal/types.h" #include /* Conversion tables for the Devanagari version of ISCII (IS 13194:1991). * * They do not map the ISCII characters INV (0xD9), ATR (0xEF), and EXT (0xF0). * They do not map U+0958--095E to sequences of two ISCII characters, of which * the second would be the combining nukta (0xE9). */ /* The following table is based on LGPL code by Sandeep Patnaik * (patnaik@students.iiit.net) and Sunil Mohan Adapa * (sunilmohanadapa@postmark.net). */ #define RTL_TEXTENC_ISCII_DEVANAGARI_START 0xA1 #define RTL_TEXTENC_ISCII_DEVANAGARI_END 0xFA static sal_uInt16 const aImplIsciiDevanagariToUniTab[RTL_TEXTENC_ISCII_DEVANAGARI_END - RTL_TEXTENC_ISCII_DEVANAGARI_START + 1] = { 0x0901, 0x0902, 0x0903, 0x0905, 0x0906, 0x0907, 0x0908, /* A0 */ 0x0909, 0x090A, 0x090B, 0x090E, 0x090F, 0x0910, 0x090D, 0x0912, 0x0913, 0x0914, 0x0911, 0x0915, 0x0916, 0x0917, 0x0918, 0x0919, /* B0 */ 0x091A, 0x091B, 0x091C, 0x091D, 0x091E, 0x091F, 0x0920, 0x0921, 0x0922, 0x0923, 0x0924, 0x0925, 0x0926, 0x0927, 0x0928, 0x0929, /* C0 */ 0x092A, 0x092B, 0x092C, 0x092D, 0x092E, 0x092F, 0x095F, 0x0930, 0x0931, 0x0932, 0x0933, 0x0934, 0x0935, 0x0936, 0x0937, 0x0938, /* D0 */ 0x0939, 0, 0x093E, 0x093F, 0x0940, 0x0941, 0x0942, 0x0943, 0x0946, 0x0947, 0x0948, 0x0945, 0x094A, 0x094B, 0x094C, 0x0949, /* E0 */ 0x094D, 0x093C, 0x0964, 0, 0, 0, 0, 0, 0, 0x0966, 0x0967, 0x0968, 0x0969, 0x096A, 0x096B, 0x096C, /* F0 */ 0x096D, 0x096E, 0x096F }; #define RTL_TEXTENC_UNICODE_DEVANAGARI_START 0x0901 #define RTL_TEXTENC_UNICODE_DEVANAGARI_END 0x096F static sal_uChar const aImplUniToIsciiDevanagariTab[RTL_TEXTENC_UNICODE_DEVANAGARI_END - RTL_TEXTENC_UNICODE_DEVANAGARI_START + 1] = { 0xA1, 0xA2, 0xA3, 0, 0xA4, 0xA5, 0xA6, /* U+0900 */ 0xA7, 0xA8, 0xA9, 0xAA, 0, 0xAE, 0xAB, 0xAC, 0xAD, 0xB2, 0xAF, 0xB0, 0xB1, 0xB3, 0xB4, 0xB5, /* U+0910 */ 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, /* U+0920 */ 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, /* U+0930 */ 0xD7, 0xD8, 0, 0, 0xE9, 0, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, 0, 0xE3, 0xE0, 0xE1, /* U+0940 */ 0xE2, 0xE7, 0xE4, 0xE5, 0xE6, 0xE8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* U+0950 */ 0, 0, 0, 0, 0, 0, 0, 0xCE, 0, 0, 0, 0, 0xEA, 0, 0xF1, 0xF2, /* U+0960 */ 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA }; static ImplByteConvertData const aImplIsciiDevanagariConvertData = { aImplIsciiDevanagariToUniTab, NULL, RTL_TEXTENC_ISCII_DEVANAGARI_START, RTL_TEXTENC_ISCII_DEVANAGARI_END, NOTABUNI_START, NOTABUNI_END, aImplUniToIsciiDevanagariTab, NULL, NULL, RTL_TEXTENC_UNICODE_DEVANAGARI_START, RTL_TEXTENC_UNICODE_DEVANAGARI_END, NOTABCHAR_START, NOTABCHAR_END, 0 }; static ImplTextEncodingData const aImplIsciiDevanagariTextEncodingData = { { &aImplIsciiDevanagariConvertData, &ImplCharToUnicode, &ImplUnicodeToChar, NULL, NULL, NULL, NULL, NULL, NULL }, 1, 1, 1, 1, NULL, NULL, RTL_TEXTENCODING_INFO_ASCII };