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