1*16d86563SAlexander Pyhalov /* 2*16d86563SAlexander Pyhalov * CDDL HEADER START 3*16d86563SAlexander Pyhalov * 4*16d86563SAlexander Pyhalov * The contents of this file are subject to the terms of the 5*16d86563SAlexander Pyhalov * Common Development and Distribution License (the "License"). 6*16d86563SAlexander Pyhalov * You may not use this file except in compliance with the License. 7*16d86563SAlexander Pyhalov * 8*16d86563SAlexander Pyhalov * You can obtain a copy of the license at src/OPENSOLARIS.LICENSE 9*16d86563SAlexander Pyhalov * or http://www.opensolaris.org/os/licensing. 10*16d86563SAlexander Pyhalov * See the License for the specific language governing permissions 11*16d86563SAlexander Pyhalov * and limitations under the License. 12*16d86563SAlexander Pyhalov * 13*16d86563SAlexander Pyhalov * When distributing Covered Code, include this CDDL HEADER in each 14*16d86563SAlexander Pyhalov * file and include the License file at src/OPENSOLARIS.LICENSE. 15*16d86563SAlexander Pyhalov * If applicable, add the following below this CDDL HEADER, with the 16*16d86563SAlexander Pyhalov * fields enclosed by brackets "[]" replaced with your own identifying 17*16d86563SAlexander Pyhalov * information: Portions Copyright [yyyy] [name of copyright owner] 18*16d86563SAlexander Pyhalov * 19*16d86563SAlexander Pyhalov * CDDL HEADER END 20*16d86563SAlexander Pyhalov */ 21*16d86563SAlexander Pyhalov /* 22*16d86563SAlexander Pyhalov * Copyright (c) 1996 by Sun Microsystems, Inc. 23*16d86563SAlexander Pyhalov */ 24*16d86563SAlexander Pyhalov 25*16d86563SAlexander Pyhalov 26*16d86563SAlexander Pyhalov 27*16d86563SAlexander Pyhalov #ifndef _COMMON_UTF_H_ 28*16d86563SAlexander Pyhalov #define _COMMON_UTF_H_ 29*16d86563SAlexander Pyhalov 30*16d86563SAlexander Pyhalov #include "common_thai.h" 31*16d86563SAlexander Pyhalov 32*16d86563SAlexander Pyhalov #define UTF_UDC_ERROR 0xFFFF /* if occur error during UDC conversion */ 33*16d86563SAlexander Pyhalov /* the code value will be filled by this */ 34*16d86563SAlexander Pyhalov 35*16d86563SAlexander Pyhalov #define IDX_UDC_ERROR -1 /* if occur error during getting UDC index */ 36*16d86563SAlexander Pyhalov /* the code value will be filled by this */ 37*16d86563SAlexander Pyhalov 38*16d86563SAlexander Pyhalov #define UNICODE_JAMO_START 0x1100 /* HANGUL JAMO code Area in Unicode 2.0 */ 39*16d86563SAlexander Pyhalov #define UNICODE_JAMO_END 0x11F9 40*16d86563SAlexander Pyhalov 41*16d86563SAlexander Pyhalov #define UNICODE_CMPJAMO_START 0x3131 /* HANGUL Compatibility JAMO code Area */ 42*16d86563SAlexander Pyhalov #define UNICODE_CMPJAMO_END 0x318E /* in Unicode 2.0 */ 43*16d86563SAlexander Pyhalov 44*16d86563SAlexander Pyhalov #define UNICODE_HANGUL_START 0xAC00 /* HANGUL code Area in Unicode 2.0 */ 45*16d86563SAlexander Pyhalov #define UNICODE_HANGUL_END 0xD7A3 46*16d86563SAlexander Pyhalov 47*16d86563SAlexander Pyhalov extern hcode_type _uni_to_utf8(hcode_type unicode); 48*16d86563SAlexander Pyhalov extern hcode_type _utf8_to_uni(hcode_type utf8code); 49*16d86563SAlexander Pyhalov 50*16d86563SAlexander Pyhalov extern hcode_type _udcidx_to_utf(int udcidx); 51*16d86563SAlexander Pyhalov /* Return UTF-8 code from given User Defined Character Index(Serial Number) */ 52*16d86563SAlexander Pyhalov 53*16d86563SAlexander Pyhalov extern int _utf_to_udcidx(hcode_type utf_code); 54*16d86563SAlexander Pyhalov /* Return User Defined Character Index(Serial Number) from given UTF-8 code */ 55*16d86563SAlexander Pyhalov 56*16d86563SAlexander Pyhalov #endif /* _COMMON_UTF_H_ */ 57