add support for zh_CN.GB18030 locale.

(lib/20835 by sigsegv at s25 dot xrea dot com)
XXX: charclass for GBK compatible area is not supported.
This commit is contained in:
tshiozak 2003-03-25 18:26:51 +00:00
parent d0db871d32
commit c2cadb8a46
12 changed files with 928 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.391 2003/03/24 15:24:46 atatat Exp $
# $NetBSD: mi,v 1.392 2003/03/25 18:26:51 tshiozak Exp $
. base-sys-root
./altroot base-sys-root
./bin base-sys-root
@ -1159,6 +1159,8 @@
./usr/share/locale/uk_UA.KOI8-U base-locale-uk
./usr/share/locale/uk_UA.KOI8-U/LC_CTYPE base-locale-uk
./usr/share/locale/zh_CN base-locale-zh
./usr/share/locale/zh_CN.GB18030 base-locale-zh
./usr/share/locale/zh_CN.GB18030/LC_CTYPE base-locale-zh
./usr/share/locale/zh_CN.eucCN base-locale-zh
./usr/share/locale/zh_CN.eucCN/LC_CTYPE base-locale-zh
./usr/share/locale/zh_CN/LC_MESSAGES base-locale-zh

View File

@ -1,4 +1,4 @@
# $NetBSD: shl.elf,v 1.66 2003/02/26 22:31:02 thorpej Exp $
# $NetBSD: shl.elf,v 1.67 2003/03/25 18:26:51 tshiozak Exp $
# Note: libtermcap and libtermlib are hardlinked and share the same version.
./lib/libc.so.12 base-sys-shlib
./lib/libcrypt.so.0 base-sys-shlib
@ -14,6 +14,7 @@
./lib/libz.so.0 base-sys-shlib
./libexec/ld.elf_so base-sys-shlib
./usr/lib/i18n/libBIG5.so.4 base-i18n-shlib
./usr/lib/i18n/libGBK2K.so.4 base-i18n-shlib
./usr/lib/i18n/libEUC.so.4 base-i18n-shlib
./usr/lib/i18n/libEUCTW.so.4 base-i18n-shlib
./usr/lib/i18n/libISO2022.so.4 base-i18n-shlib

View File

@ -1,4 +1,4 @@
# $NetBSD: shl.mi,v 1.204 2003/03/22 12:44:02 jdolecek Exp $
# $NetBSD: shl.mi,v 1.205 2003/03/25 18:26:51 tshiozak Exp $
# Note: libtermcap and libtermlib are hardlinked and share the same version.
./lib/libc.so.12.96 base-sys-shlib
./lib/libcrypt.so.0.1 base-sys-shlib
@ -13,6 +13,7 @@
./lib/libutil.so.7.2 base-sys-shlib
./lib/libz.so.0.3 base-sys-shlib
./usr/lib/i18n/libBIG5.so.4.1 base-i18n-shlib
./usr/lib/i18n/libGBK2K.so.4.1 base-i18n-shlib
./usr/lib/i18n/libEUC.so.4.1 base-i18n-shlib
./usr/lib/i18n/libEUCTW.so.4.1 base-i18n-shlib
./usr/lib/i18n/libISO2022.so.4.1 base-i18n-shlib

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.546 2003/03/22 12:44:02 jdolecek Exp $
# $NetBSD: mi,v 1.547 2003/03/25 18:26:52 tshiozak Exp $
./usr/bin/addr2line comp-debug-bin
./usr/bin/ar comp-util-bin
./usr/bin/as comp-util-bin
@ -911,6 +911,7 @@
./usr/lib/crt0.o comp-c-lib
./usr/lib/gcrt0.o comp-c-lib
./usr/lib/i18n/libBIG5.a comp-i18n-lib
./usr/lib/i18n/libGBK2K.a comp-i18n-lib
./usr/lib/i18n/libEUC.a comp-i18n-lib
./usr/lib/i18n/libEUCTW.a comp-i18n-lib
./usr/lib/i18n/libISO2022.a comp-i18n-lib

View File

@ -1,4 +1,4 @@
# $NetBSD: shl.elf,v 1.35 2003/02/26 22:31:14 thorpej Exp $
# $NetBSD: shl.elf,v 1.36 2003/03/25 18:26:53 tshiozak Exp $
./lib/libc.so comp-c-lib
./lib/libcrypt.so comp-c-lib
./lib/libcrypto.so comp-c-lib
@ -14,6 +14,7 @@
./usr/lib/crtbeginS.o comp-c-lib
./usr/lib/crtendS.o comp-c-lib
./usr/lib/i18n/libBIG5.so comp-i18n-lib
./usr/lib/i18n/libGBK2K.so comp-i18n-lib
./usr/lib/i18n/libEUC.so comp-i18n-lib
./usr/lib/i18n/libEUCTW.so comp-i18n-lib
./usr/lib/i18n/libISO2022.so comp-i18n-lib

View File

@ -1,4 +1,4 @@
# $NetBSD: NetBSD.dist,v 1.221 2003/03/24 15:21:18 atatat Exp $
# $NetBSD: NetBSD.dist,v 1.222 2003/03/25 18:26:53 tshiozak Exp $
# @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93
/set type=dir uname=root gname=wheel mode=0755
@ -391,6 +391,7 @@
./usr/share/locale/tr/LC_MESSAGES
./usr/share/locale/uk_UA.KOI8-U
./usr/share/locale/zh_CN
./usr/share/locale/zh_CN.GB18030
./usr/share/locale/zh_CN.eucCN
./usr/share/locale/zh_CN/LC_MESSAGES
./usr/share/locale/zh_TW

View File

@ -0,0 +1,5 @@
# $NetBSD: Makefile,v 1.1 2003/03/25 18:26:54 tshiozak Exp $
SRCPRE=citrus_
#CFLAGS+=-g
.include <bsd.lib.mk>

View File

@ -1,5 +1,5 @@
# $NetBSD: Makefile,v 1.1 2002/03/17 22:14:13 tshiozak Exp $
# $NetBSD: Makefile,v 1.2 2003/03/25 18:26:54 tshiozak Exp $
SUBDIR= BIG5 EUC EUCTW ISO2022 MSKanji UTF8
SUBDIR= BIG5 EUC EUCTW GBK2K ISO2022 MSKanji UTF8
.include <bsd.subdir.mk>

View File

@ -0,0 +1,348 @@
/* $NetBSD: citrus_gbk2k.c,v 1.1 2003/03/25 18:26:54 tshiozak Exp $ */
/*-
* Copyright (c)2003 Citrus Project,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: citrus_gbk2k.c,v 1.1 2003/03/25 18:26:54 tshiozak Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <locale.h>
#include <wchar.h>
#include <sys/types.h>
#include <limits.h>
#include "citrus_module.h"
#include "citrus_ctype.h"
#include "citrus_gbk2k.h"
/* ----------------------------------------------------------------------
* private stuffs used by templates
*/
typedef struct _GBK2KState {
char ch[4];
int chlen;
} _GBK2KState;
typedef struct {
int dummy;
} _GBK2KEncodingInfo;
typedef struct {
_GBK2KEncodingInfo ei;
struct {
/* for future multi-locale facility */
_GBK2KState s_mblen;
_GBK2KState s_mbrlen;
_GBK2KState s_mbrtowc;
_GBK2KState s_mbtowc;
_GBK2KState s_mbsrtowcs;
_GBK2KState s_wcrtomb;
_GBK2KState s_wcsrtombs;
_GBK2KState s_wctomb;
} states;
} _GBK2KCTypeInfo;
#define _CEI_TO_EI(_cei_) (&(_cei_)->ei)
#define _CEI_TO_STATE(_cei_, _func_) (_cei_)->states.s_##_func_
#define _FUNCNAME(m) _citrus_GBK2K_##m
#define _ENCODING_INFO _GBK2KEncodingInfo
#define _CTYPE_INFO _GBK2KCTypeInfo
#define _ENCODING_STATE _GBK2KState
#define _ENCODING_MB_CUR_MAX(_ei_) 4
#define _ENCODING_IS_STATE_DEPENDENT 0
#define _STATE_NEEDS_EXPLICIT_INIT(_ps_) 0
static __inline void
/*ARGSUSED*/
_citrus_GBK2K_init_state(_GBK2KEncodingInfo * __restrict ei,
_GBK2KState * __restrict s)
{
memset(s, 0, sizeof(*s));
}
static __inline void
/*ARGSUSED*/
_citrus_GBK2K_pack_state(_GBK2KEncodingInfo * __restrict ei,
void * __restrict pspriv,
const _GBK2KState * __restrict s)
{
memcpy(pspriv, (const void *)s, sizeof(*s));
}
static __inline void
/*ARGSUSED*/
_citrus_GBK2K_unpack_state(_GBK2KEncodingInfo * __restrict ei,
_GBK2KState * __restrict s,
const void * __restrict pspriv)
{
memcpy((void *)s, pspriv, sizeof(*s));
}
static __inline int
_mb_singlebyte(int c)
{
c &= 0xff;
return (c <= 0x7f);
}
static __inline int
_mb_leadbyte(int c)
{
c &= 0xff;
return (0x81 <= c && c <= 0xfe);
}
static __inline int
_mb_trailbyte(int c)
{
c &= 0xff;
return ((0x40 <= c && c <= 0x7e) || (0x80 <= c && c <= 0xfe));
}
static __inline int
_mb_surrogate(int c)
{
c &= 0xff;
return (0x30 <= c && c <= 0x39);
}
static __inline int
_mb_count(wchar_t v)
{
u_int32_t c;
c = (u_int32_t)v; /* XXX */
if (!(c & 0xffffff00))
return (1);
if (!(c & 0xffff0000))
return (2);
return (4);
}
#define _PSENC (psenc->ch[psenc->chlen - 1])
#define _PUSH_PSENC(c) (psenc->ch[psenc->chlen++] = (c))
static int
_citrus_GBK2K_mbrtowc_priv(_GBK2KEncodingInfo * __restrict ei,
wchar_t * __restrict pwc,
const char ** __restrict s, size_t n,
_GBK2KState * __restrict psenc,
size_t * __restrict nresult)
{
int chlenbak, len;
const char *s0, *s1;
wchar_t wc;
_DIAGASSERT(ei != NULL);
/* pwc may be NULL */
_DIAGASSERT(s != NULL);
_DIAGASSERT(psenc != NULL);
s0 = *s;
if (s0 == NULL) {
/* _citrus_GBK2K_init_state(ei, psenc); */
psenc->chlen = 0;
*nresult = 0;
return (0);
}
chlenbak = psenc->chlen;
switch (psenc->chlen) {
case 3:
if (!_mb_leadbyte (_PSENC))
goto invalid;
/* FALLTHROUGH */
case 2:
if (!_mb_surrogate(_PSENC) || _mb_trailbyte(_PSENC))
goto invalid;
/* FALLTHROUGH */
case 1:
if (!_mb_leadbyte (_PSENC))
goto invalid;
/* FALLTHOROUGH */
case 0:
break;
default:
goto invalid;
}
for (;;) {
if (n-- < 1)
goto restart;
_PUSH_PSENC(*s0++);
switch (psenc->chlen) {
case 1:
if (_mb_singlebyte(_PSENC))
goto convert;
if (_mb_leadbyte (_PSENC))
continue;
goto ilseq;
case 2:
if (_mb_trailbyte (_PSENC))
goto convert;
if (_mb_surrogate (_PSENC))
continue;
goto ilseq;
case 3:
if (_mb_leadbyte (_PSENC))
continue;
goto ilseq;
case 4:
if (_mb_surrogate (_PSENC))
goto convert;
goto ilseq;
default:
/* NOT REACHED */
}
}
convert:
len = psenc->chlen;
s1 = &psenc->ch[0];
wc = 0;
while (len-- > 0)
wc = (wc << 8) | (*s1++ & 0xff);
if (pwc != NULL)
*pwc = wc;
*s = s0;
*nresult = (wc == 0) ? 0 : psenc->chlen - chlenbak;
/* _citrus_GBK2K_init_state(ei, psenc); */
psenc->chlen = 0;
return (0);
restart:
*s = s0;
*nresult = (size_t)-2;
return (0);
invalid:
return (EINVAL);
ilseq:
*nresult = (size_t)-1;
return (EILSEQ);
}
static int
_citrus_GBK2K_wcrtomb_priv(_GBK2KEncodingInfo * __restrict ei,
char * __restrict s, size_t n, wchar_t wc,
_GBK2KState * __restrict psenc,
size_t * __restrict nresult)
{
int len;
_DIAGASSERT(ei != NULL);
_DIAGASSERT(s != NULL);
_DIAGASSERT(psenc != NULL);
if (psenc->chlen != 0)
goto invalid;
len = _mb_count(wc);
if (n < len)
goto ilseq;
switch (len) {
case 1:
if (!_mb_singlebyte(_PUSH_PSENC(wc )))
goto ilseq;
break;
case 2:
if (!_mb_leadbyte (_PUSH_PSENC(wc >> 8)) ||
!_mb_trailbyte (_PUSH_PSENC(wc )))
goto ilseq;
break;
case 4:
if (!_mb_leadbyte (_PUSH_PSENC(wc >> 24)) ||
!_mb_surrogate (_PUSH_PSENC(wc >> 16)) ||
!_mb_leadbyte (_PUSH_PSENC(wc >> 8)) ||
!_mb_surrogate (_PUSH_PSENC(wc )))
goto ilseq;
break;
default:
/* NOT REACHED */
}
_DIAGASSERT(len == psenc->chlen);
memcpy(s, psenc->ch, psenc->chlen);
*nresult = psenc->chlen;
/* _citrus_GBK2K_init_state(ei, psenc); */
psenc->chlen = 0;
return (0);
invalid:
return (EINVAL);
ilseq:
*nresult = (size_t)-1;
return (EILSEQ);
}
static int
/*ARGSUSED*/
_citrus_GBK2K_stdencoding_init(_GBK2KEncodingInfo * __restrict ei,
const void * __restrict var, size_t lenvar)
{
_DIAGASSERT(ei != NULL);
memset((void *)ei, 0, sizeof(*ei));
return (0);
}
static void
/*ARGSUSED*/
_citrus_GBK2K_stdencoding_uninit(_GBK2KEncodingInfo *ei)
{
}
/* ----------------------------------------------------------------------
* public interface for ctype
*/
_CITRUS_CTYPE_DECLS(GBK2K);
_CITRUS_CTYPE_DEF_OPS(GBK2K);
#include "citrus_ctype_template.h"

View File

@ -0,0 +1,36 @@
/* $NetBSD: citrus_gbk2k.h,v 1.1 2003/03/25 18:26:54 tshiozak Exp $ */
/*-
* Copyright (c)2003 Citrus Project,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _CITRUS_GBK2K_H_
#define _CITRUS_GBK2K_H_
__BEGIN_DECLS
_CITRUS_CTYPE_GETOPS_FUNC(GBK2K);
__END_DECLS
#endif

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.9 2002/09/18 03:02:12 lukem Exp $
# $NetBSD: Makefile,v 1.10 2003/03/25 18:26:55 tshiozak Exp $
NOMAN= # defined
@ -9,6 +9,10 @@ FILESOWN= ${LOCALEOWN}
FILESGRP= ${LOCALEGRP}
FILESMODE= ${LOCALEMODE}
LOCALES += zh_CN.GB18030
LOCALESRC_zh_CN.GB18030 = zh_CN.GB18030
ALIASES_zh_CN.GB18030+=
LOCALES += da_DK.ISO8859-1
LOCALESRC_da_DK.ISO8859-1 = en_US.ISO_8859-1
ALIASES_da_DK.ISO8859-1+=

View File

@ -0,0 +1,519 @@
/* $NetBSD: zh_CN.GB18030.src,v 1.1 2003/03/25 18:26:55 tshiozak Exp $ */
/*-
* Copyright (c) 1998, Luoqi Chen
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* NetBSD: zh_CN.eucCN.src,v 1.2 2001/03/26 19:56:37 tshiozak Exp
* FreeBSD: src/usr.bin/mklocale/data/zh_CN.EUC.src,v 1.2.2.1 1999/08/29 15:31:06 peter Exp
*/
ENCODING "GBK2K"
VARIABLE CODESET=GB18030
/*
* ASCII
*/
ALPHA 'A' - 'Z' 'a' - 'z'
CONTROL 0x00 - 0x1f 0x7f
DIGIT '0' - '9'
GRAPH 0x21 - 0x7e
LOWER 'a' - 'z'
PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e
SPACE 0x09 - 0x0d 0x20
UPPER 'A' - 'Z'
XDIGIT '0' - '9' 'a' - 'f' 'A' - 'F'
BLANK ' ' '\t'
PRINT 0x20 - 0x7e
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 : 10 > < 0xa3e1 - 0xa3e6 : 10 >
PHONOGRAM 0xa4a1 - 0xa4f3 /* Hiragana */
PHONOGRAM 0xa5a1 - 0xa5f6 /* Katakana */
SWIDTH2 0xa4a1 - 0xa4f3 /* Hiragana */
SWIDTH2 0xa5a1 - 0xa5f6 /* Katakana */
UPPER 0xa6a1 - 0xa6b8 /* Greek */
LOWER 0xa6c1 - 0xa6d8 /* Greek */
SWIDTH2 0xa6a1 - 0xa6b8 /* Greek */
SWIDTH2 0xa6c1 - 0xa6d8 /* Greek */
MAPLOWER < 0xa6a1 - 0xa6b8 : 0xa6c1 > < 0xa6c1 - 0xa6d8 : 0xa6c1 >
MAPUPPER < 0xa6a1 - 0xa6b8 : 0xa6a1 > < 0xa6c1 - 0xa6d8 : 0xa6a1 >
UPPER 0xa7a1 - 0xa7c1 /* Cyrillic */
LOWER 0xa7d1 - 0xa7f1 /* Cyrillic */
SWIDTH2 0xa7a1 - 0xa7c1 /* Cyrillic */
SWIDTH2 0xa7d1 - 0xa7f1 /* Cyrillic */
MAPLOWER < 0xa7a1 - 0xa7c1 : 0xa7d1 > < 0xa7d1 - 0xa7f1 : 0xa7d1 >
MAPUPPER < 0xa7a1 - 0xa7c1 : 0xa7a1 > < 0xa7d1 - 0xa7f1 : 0xa7a1 >
SPECIAL 0xa8a1 - 0xa8ba
SWIDTH2 0xa8a1 - 0xa8ba
PHONOGRAM 0xa8c5 - 0xa8e9 /* Pin yin */
SWIDTH2 0xa8c5 - 0xa8e9 /* Pin yin */
SPECIAL 0xa9a4 - 0xa9ef /* Box drawings */
SWIDTH2 0xa9a4 - 0xa9ef /* Box drawings */
IDEOGRAM 0xb0a1 - 0xb0fe
IDEOGRAM 0xb1a1 - 0xb1fe
IDEOGRAM 0xb2a1 - 0xb2fe
IDEOGRAM 0xb3a1 - 0xb3fe
IDEOGRAM 0xb4a1 - 0xb4fe
IDEOGRAM 0xb5a1 - 0xb5fe
IDEOGRAM 0xb6a1 - 0xb6fe
IDEOGR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 - 0xdea0
IDEOGRAM 0xdf40 - 0xdfa0
IDEOGRAM 0xe040 - 0xe0a0
IDEOGRAM 0xe140 - 0xe1a0
IDEOGRAM 0xe240 - 0xe2a0
IDEOGRAM 0xe340 - 0xe3a0
IDEOGRAM 0xe440 - 0xe4a0
IDEOGRAM 0xe540 - 0xe5a0
IDEOGRAM 0xe640 - 0xe6a0
IDEOGRAM 0xe740 - 0xe7a0
IDEOGRAM 0xe840 - 0xe8a0
IDEOGRAM 0xe940 - 0xe9a0
IDEOGRAM 0xea40 - 0xeaa0
IDEOGRAM 0xeb40 - 0xeba0
IDEOGRAM 0xec40 - 0xeca0
IDEOGRAM 0xed40 - 0xeda0
IDEOGRAM 0xee40 - 0xeea0
IDEOGRAM 0xef40 - 0xefa0
IDEOGRAM 0xf040 - 0xf0a0
IDEOGRAM 0xf140 - 0xf1a0
IDEOGRAM 0xf240 - 0xf2a0
IDEOGRAM 0xf340 - 0xf3a0
IDEOGRAM 0xf440 - 0xf4a0
IDEOGRAM 0xf540 - 0xf5a0
IDEOGRAM 0xf640 - 0xf6a0
IDEOGRAM 0xf740 - 0xf7a0
IDEOGRAM 0xf840 - 0xf8fe
IDEOGRAM 0xf940 - 0xf9fe
IDEOGRAM 0xfa40 - 0xfafe
IDEOGRAM 0xfb40 - 0xfbfe
IDEOGRAM 0xfc40 - 0xfcfe
IDEOGRAM 0xfd40 - 0xfdfe
IDEOGRAM 0xfe40 - 0xfefe
/*
* Unicode (to be written...)
*/