Hi Here is a patch for XFree86 4.1.0 to support GB18030. I wrote it long time ago (About June 2001).
It's only a workable patch, it's far from perfect. Regards James Su Chulkee Sung wrote: >Anthony, and >all gb18030 support interested, > >Thanks for your comments. > >I seems that support of gb18030 support in glibc level is quite solid, of >course I see many debates. I personally think that our glibc should handle >all code points regardless that they are assigned or not as long as that are >legal. This I believe is worth to continue to discuss. > >In X; however, I saw many gb18030 related discussions; however, I did not >see any solid conclusion or finished implementation just by reading mail >threads in xfree86. >My questions as follows still remains unresolved. > >DISPLAY of gb18030: For gb18030 two- or/and four-byte characters: (Xlib 4.1, >Glibc 2.2.4) > I can dispplay only after I convert them into utf-8 using iconv and >using unifont. > I tried various settings of XLC-LOCALE along with gb18030 fonts, but all >failed. > > Q: How can a gb8030 characters be displayed without conversion with >gb18030 fonts. > >LOCALE SETTING for GB18030: > Q: Would modification of XLC_LOCLAE and/or fonts' encoding file be >enough OR > are there more to do ? > Q: Are there an official files for XLC_LCOALE, etc. that XFree86.org >recommend > for gb18030 support ? > >Chulkee, > > > >----- Original Message ----- >From: "Anthony Fok" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Tuesday, March 26, 2002 7:02 AM >Subject: Re: [I18n]XFree86 4.1 gb188030 support > > >>Hello Chulkee, >> >>The questions you asked about GB18030 are probably all addressed >>already, mainly by James Su and by other developers worldwide. You'll >>probably need to search on various mailing lists and web sites to find >>all the details and information. >> >>On Mon, Mar 25, 2002 at 10:45:12AM -0700, Chulkee Sung wrote: >> >>>GLIBC: >>>Each time when I use iconv to convert to UTF-8, "invalid gb18030 >>> >sequence > >>>error", is reported, but when I checked my gb18030 four-byte data, they >>>are all in VALID code points, but I wouldn't know if they are all >>>assigned. >>> >>See the discussion at: >> >> http://sources.redhat.com/ml/libc-alpha/2002-01/ >> >>Scroll down to "January 15, 2002" and read the thread starting with >>this message: >> >> "New GB18030 gconv module contributed by ThizLinux Laboratory" >> >>At the time, Ulrich and Yu Shao were not willing to put any >>legal-but-unassigned codepoints in gb18030.c, and intentionally put >>NULL in there, hence the "invalid gb18030 sequence" error. Other >>developers and I weren't able to convince them. If you can convince >>Ulrich and Yu Shao otherwise, please do. >> >>Nevertheless, follow the discussion, and you'll find a link to a >>gb18030.c (GB18030<->Unicode gconv module) that is actually complete. >>Make sure you grab the one dated 2002-02-21, which is a few percent >>faster than the 2002-01-15 versions. >> >>Cheers, >> >>Anthony >> >>-- >>Anthony Fok Tung-Ling >>ThizLinux Laboratory <[EMAIL PROTECTED]> http://www.thizlinux.com/ >>Debian Chinese Project <[EMAIL PROTECTED]> >> >http://www.debian.org/intl/zh/ > >>Come visit Our Lady of Victory Camp! http://www.olvc.ab.ca/ >>_______________________________________________ >>I18n mailing list >>[EMAIL PROTECTED] >>http://XFree86.Org/mailman/listinfo/i18n >> > >_______________________________________________ >I18n mailing list >[EMAIL PROTECTED] >http://XFree86.Org/mailman/listinfo/i18n > >
diff -urN XFree86-4.1.0/xc/lib/X11/lcUTF8.c XFree86-4.1.0.gb18030/xc/lib/X11/lcUTF8.c --- XFree86-4.1.0/xc/lib/X11/lcUTF8.c Fri Feb 9 08:02:53 2001 +++ XFree86-4.1.0.gb18030/xc/lib/X11/lcUTF8.c Wed Jun 20 12:06:31 2001 @@ -71,6 +71,10 @@ * without first going through the list of predefined character sets. */ +/* + * Modified by James Su <[EMAIL PROTECTED]> to support GB18030 Locale + */ + #include <stdio.h> #include "Xlibint.h" #include "XlcPubI.h" @@ -1798,6 +1802,585 @@ return create_tofontcs_conv(from_lcd, &methods_utf8tocs); } +/* ========================== iconv Stuff ================================ */ + +/* from XlcNCharSet to XlcNMultiByte */ + +static int +iconv_cstombs(conv, from, from_left, to, to_left, args, num_args) + XlcConv conv; + XPointer *from; + int *from_left; + XPointer *to; + int *to_left; + XPointer *args; + int num_args; +{ + XlcCharSet charset; + char *name; + Utf8Conv convptr; + int i; + unsigned char const *src; + unsigned char const *srcend; + unsigned char *dst; + unsigned char *dstend; + int unconv_num; + + if (from == NULL || *from == NULL) + return 0; + + if (num_args < 1) + return -1; + + charset = (XlcCharSet) args[0]; + name = charset->encoding_name; + /* not charset->name because the latter has a ":GL"/":GR" suffix */ + + for (convptr = all_charsets, i = all_charsets_count-1; i > 0; convptr++, i--) + if (!strcmp(convptr->name, name)) + break; + if (i == 0) + return -1; + + src = (unsigned char const *) *from; + srcend = src + *from_left; + dst = (unsigned char *) *to; + dstend = dst + *to_left; + unconv_num = 0; + + while (src < srcend) { + ucs4_t wc; + int consumed; + int count; + + consumed = convptr->cstowc(conv, &wc, src, srcend-src); + if (consumed == RET_ILSEQ) + return -1; + if (consumed == RET_TOOFEW(0)) + break; + + /* Use stdc iconv to convert widechar -> multibyte */ + + count = wctomb(dst, wc); + if (count == 0) + break; + if (count == -1) { + count = wctomb(dst, BAD_WCHAR); + if (count == 0) + break; + unconv_num++; + } + src += consumed; + dst += count; + } + + *from = (XPointer) src; + *from_left = srcend - src; + *to = (XPointer) dst; + *to_left = dstend - dst; + + return unconv_num; + +} + +static XlcConvMethodsRec iconv_cstombs_methods = { + close_converter, + iconv_cstombs, + NULL +}; + +static XlcConv +open_iconv_cstombs(from_lcd, from_type, to_lcd, to_type) + XLCd from_lcd; + char *from_type; + XLCd to_lcd; + char *to_type; +{ + lazy_init_all_charsets(); + return create_conv(from_lcd, &iconv_cstombs_methods); +} + +static int +iconv_mbstocs(conv, from, from_left, to, to_left, args, num_args) + XlcConv conv; + XPointer *from; + int *from_left; + XPointer *to; + int *to_left; + XPointer *args; + int num_args; +{ + Utf8Conv *preferred_charsets; + XlcCharSet last_charset = NULL; + unsigned char const *src; + unsigned char const *srcend; + unsigned char *dst; + unsigned char *dstend; + int unconv_num; + + if (from == NULL || *from == NULL) + return 0; + + preferred_charsets = (Utf8Conv *) conv->state; + src = (unsigned char const *) *from; + srcend = src + *from_left; + dst = (unsigned char *) *to; + dstend = dst + *to_left; + unconv_num = 0; + + while (src < srcend && dst < dstend) { + Utf8Conv chosen_charset = NULL; + XlcSide chosen_side = XlcNONE; + wchar_t wc; + int consumed; + int count; + + /* Uses stdc iconv to convert multibyte -> widechar */ + + consumed = mbtowc(&wc, src, srcend-src); + if (consumed == 0) + break; + if (consumed == -1) { + src++; + unconv_num++; + continue; + } + + count = charset_wctocs(preferred_charsets, &chosen_charset, &chosen_side, +conv, dst, wc, dstend-dst); + + if (count == RET_TOOSMALL) + break; + if (count == RET_ILSEQ) { + src += consumed; + unconv_num++; + continue; + } + + if (last_charset == NULL) { + last_charset = + _XlcGetCharSetWithSide(chosen_charset->name, chosen_side); + if (last_charset == NULL) { + src += consumed; + unconv_num++; + continue; + } + } else { + if (!(last_charset->xrm_encoding_name == chosen_charset->xrm_name + && (last_charset->side == XlcGLGR + || last_charset->side == chosen_side))) + break; + } + src += consumed; + dst += count; + } + + if (last_charset == NULL) + return -1; + + *from = (XPointer) src; + *from_left = srcend - src; + *to = (XPointer) dst; + *to_left = dstend - dst; + + if (num_args >= 1) + *((XlcCharSet *)args[0]) = last_charset; + + return unconv_num; +} + +static XlcConvMethodsRec iconv_mbstocs_methods = { + close_tocs_converter, + iconv_mbstocs, + NULL +}; + +static XlcConv +open_iconv_mbstocs(from_lcd, from_type, to_lcd, to_type) + XLCd from_lcd; + char *from_type; + XLCd to_lcd; + char *to_type; +{ + return create_tocs_conv(from_lcd, &iconv_mbstocs_methods); +} + +/* from XlcNMultiByte to XlcNChar */ + +static int +iconv_mbtocs(conv, from, from_left, to, to_left, args, num_args) + XlcConv conv; + XPointer *from; + int *from_left; + XPointer *to; + int *to_left; + XPointer *args; + int num_args; +{ + Utf8Conv *preferred_charsets; + XlcCharSet last_charset = NULL; + unsigned char const *src; + unsigned char const *srcend; + unsigned char *dst; + unsigned char *dstend; + int unconv_num; + + if (from == NULL || *from == NULL) + return 0; + + preferred_charsets = (Utf8Conv *) conv->state; + src = (unsigned char const *) *from; + srcend = src + *from_left; + dst = (unsigned char *) *to; + dstend = dst + *to_left; + unconv_num = 0; + + while (src < srcend && dst < dstend) { + Utf8Conv chosen_charset = NULL; + XlcSide chosen_side = XlcNONE; + wchar_t wc; + int consumed; + int count; + + /* Uses stdc iconv to convert multibyte -> widechar */ + + consumed = mbtowc(&wc, src, srcend-src); + if (consumed == 0) + break; + if (consumed == -1) { + src++; + unconv_num++; + continue; + } + + count = charset_wctocs(preferred_charsets, &chosen_charset, &chosen_side, +conv, dst, wc, dstend-dst); + if (count == RET_TOOSMALL) + break; + if (count == RET_ILSEQ) { + src += consumed; + unconv_num++; + continue; + } + + if (last_charset == NULL) { + last_charset = + _XlcGetCharSetWithSide(chosen_charset->name, chosen_side); + if (last_charset == NULL) { + src += consumed; + unconv_num++; + continue; + } + } else { + if (!(last_charset->xrm_encoding_name == chosen_charset->xrm_name + && (last_charset->side == XlcGLGR + || last_charset->side == chosen_side))) + break; + } + src += consumed; + dst += count; + } + + if (last_charset == NULL) + return -1; + + *from = (XPointer) src; + *from_left = srcend - src; + *to = (XPointer) dst; + *to_left = dstend - dst; + + if (num_args >= 1) + *((XlcCharSet *)args[0]) = last_charset; + + return unconv_num; +} + +static XlcConvMethodsRec iconv_mbtocs_methods = { + close_tocs_converter, + iconv_mbtocs, + NULL +}; + +static XlcConv +open_iconv_mbtocs (from_lcd, from_type, to_lcd, to_type) + XLCd from_lcd; + char *from_type; + XLCd to_lcd; + char *to_type; +{ + return create_tocs_conv(from_lcd, &iconv_mbtocs_methods ); +} + +/* from XlcNMultiByte to XlcNString */ + +static int +iconv_mbstostr(conv, from, from_left, to, to_left, args, num_args) + XlcConv conv; + XPointer *from; + int *from_left; + XPointer *to; + int *to_left; + XPointer *args; + int num_args; +{ + unsigned char const *src; + unsigned char const *srcend; + unsigned char *dst; + unsigned char *dstend; + int unconv_num; + + if (from == NULL || *from == NULL) + return 0; + + src = (unsigned char const *) *from; + srcend = src + *from_left; + dst = (unsigned char *) *to; + dstend = dst + *to_left; + unconv_num = 0; + + while (src < srcend) { + unsigned char c; + wchar_t wc; + int consumed; + + /* Uses stdc iconv to convert multibyte -> widechar */ + + consumed = mbtowc(&wc, src, srcend-src); + if (consumed == 0) + break; + if (dst == dstend) + break; + if (consumed == -1) { + consumed = 1; + c = BAD_CHAR; + unconv_num++; + } else { + if ((wc & ~(wchar_t)0xff) != 0) { + c = BAD_CHAR; + unconv_num++; + } else + c = (unsigned char) wc; + } + *dst++ = c; + src += consumed; + } + + *from = (XPointer) src; + *from_left = srcend - src; + *to = (XPointer) dst; + *to_left = dstend - dst; + + return unconv_num; +} + +static XlcConvMethodsRec iconv_mbstostr_methods = { + close_converter, + iconv_mbstostr, + NULL +}; + +static XlcConv +open_iconv_mbstostr(from_lcd, from_type, to_lcd, to_type) + XLCd from_lcd; + char *from_type; + XLCd to_lcd; + char *to_type; +{ + return create_conv(from_lcd, &iconv_mbstostr_methods); +} + +/* from XlcNString to XlcNMultiByte */ +static int +iconv_strtombs(conv, from, from_left, to, to_left, args, num_args) + XlcConv conv; + XPointer *from; + int *from_left; + XPointer *to; + int *to_left; + XPointer *args; + int num_args; +{ + unsigned char const *src; + unsigned char const *srcend; + unsigned char *dst; + unsigned char *dstend; + + if (from == NULL || *from == NULL) + return 0; + + src = (unsigned char const *) *from; + srcend = src + *from_left; + dst = (unsigned char *) *to; + dstend = dst + *to_left; + + while (src < srcend) { + int count = wctomb(dst, *src); + if (count < 0) + break; + dst += count; + src++; + } + + *from = (XPointer) src; + *from_left = srcend - src; + *to = (XPointer) dst; + *to_left = dstend - dst; + + return 0; +} + +static XlcConvMethodsRec iconv_strtombs_methods= { + close_converter, + iconv_strtombs, + NULL +}; + +static XlcConv +open_iconv_strtombs(from_lcd, from_type, to_lcd, to_type) + XLCd from_lcd; + char *from_type; + XLCd to_lcd; + char *to_type; +{ + return create_conv(from_lcd, &iconv_strtombs_methods); +} + +/***************************************************************************/ +/* Part II: An iconv locale loader. + * + *Here we can assume that "multi-byte" is iconv and that `wchar_t' is Unicode. + */ + +/* from XlcNMultiByte to XlcNWideChar */ +static int +iconv_mbstowcs(conv, from, from_left, to, to_left, args, num_args) + XlcConv conv; + XPointer *from; + int *from_left; + XPointer *to; + int *to_left; + XPointer *args; + int num_args; +{ + char *src = *((char **) from); + wchar_t *dst = *((wchar_t **) to); + int src_left = *from_left; + int dst_left = *to_left; + int length, unconv_num = 0; + + while (src_left > 0 && dst_left > 0) { + length = mbtowc(dst, src, src_left); + + if (length > 0) { + src += length; + src_left -= length; + if (dst) + dst++; + dst_left--; + } else if (length < 0) { + src++; + src_left--; + unconv_num++; + } else { + /* null ? */ + src++; + src_left--; + if (dst) + *dst++ = L'\0'; + dst_left--; + } + } + + *from = (XPointer) src; + if (dst) + *to = (XPointer) dst; + *from_left = src_left; + *to_left = dst_left; + + return unconv_num; +} + +static XlcConvMethodsRec iconv_mbstowcs_methods = { + close_converter, + iconv_mbstowcs, + NULL +} ; + +static XlcConv +open_iconv_mbstowcs(from_lcd, from_type, to_lcd, to_type) + XLCd from_lcd; + char *from_type; + XLCd to_lcd; + char *to_type; +{ + return create_conv(from_lcd, &iconv_mbstowcs_methods); +} + +static int +iconv_wcstombs(conv, from, from_left, to, to_left, args, num_args) + XlcConv conv; + XPointer *from; + int *from_left; + XPointer *to; + int *to_left; + XPointer *args; + int num_args; +{ + wchar_t *src = *((wchar_t **) from); + char *dst = *((char **) to); + int src_left = *from_left; + int dst_left = *to_left; + int length, unconv_num = 0; + + while (src_left > 0 && dst_left >= MB_CUR_MAX) { + length = wctomb(dst, *src); /* XXX */ + + if (length > 0) { + src++; + src_left--; + if (dst) + dst += length; + dst_left -= length; + } else if (length < 0) { + src++; + src_left--; + unconv_num++; + } + } + + *from = (XPointer) src; + if (dst) + *to = (XPointer) dst; + *from_left = src_left; + *to_left = dst_left; + + return unconv_num; +} + +static XlcConvMethodsRec iconv_wcstombs_methods = { + close_converter, + iconv_wcstombs, + NULL +} ; + +static XlcConv +open_iconv_wcstombs(from_lcd, from_type, to_lcd, to_type) + XLCd from_lcd; + char *from_type; + XLCd to_lcd; + char *to_type; +{ + return create_conv(from_lcd, &iconv_wcstombs_methods); +} + +static XlcConv +open_iconv_mbstofcs( + XLCd from_lcd, + const char *from_type, + XLCd to_lcd, + const char *to_type) +{ + return create_tofontcs_conv(from_lcd, &iconv_mbstocs_methods); +} + XLCd _XlcUtf8Loader( const char *name) @@ -1808,21 +2391,18 @@ if (lcd == (XLCd) NULL) return lcd; - /* The official IANA name for UTF-8 is "UTF-8" in upper case with a dash. */ - if (!XLC_PUBLIC_PART(lcd)->codeset || - (_XlcCompareISOLatin1(XLC_PUBLIC_PART(lcd)->codeset, "UTF-8"))) { + if (!XLC_PUBLIC_PART(lcd)->codeset) { _XlcDestroyLC(lcd); return (XLCd) NULL; } - + /* The official IANA name for UTF-8 is "UTF-8" in upper case with a dash. */ + else if (!_XlcCompareISOLatin1(XLC_PUBLIC_PART(lcd)->codeset, "UTF-8")) { + /* Register elementary converters. */ _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNWideChar, open_utf8towcs); _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNMultiByte, open_wcstoutf8); - _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNString, open_wcstostr); - - _XlcSetConverter(lcd, XlcNString, lcd, XlcNWideChar, open_strtowcs); /* Register converters for XlcNCharSet. This implicitly provides * converters from and to XlcNCompoundText. */ @@ -1831,10 +2411,6 @@ _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNCharSet, open_utf8tocs); _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNChar, open_utf8tocs1); - _XlcSetConverter(lcd, XlcNCharSet, lcd, XlcNWideChar, open_cstowcs); - _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNCharSet, open_wcstocs); - _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNChar, open_wcstocs1); - _XlcSetConverter(lcd, XlcNString, lcd, XlcNMultiByte, open_strtoutf8); _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNString, open_utf8tostr); _XlcSetConverter(lcd, XlcNUtf8String, lcd, XlcNMultiByte, open_identity); @@ -1842,6 +2418,39 @@ /* Register converters for XlcNFontCharSet */ _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNFontCharSet, open_utf8tofcs); + } + + /* GB18030 Stuff */ + else if(!_XlcCompareISOLatin1(XLC_PUBLIC_PART(lcd)->codeset, "GB18030")) { + + /* Register elementary converters. */ + _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNWideChar, open_iconv_mbstowcs); + _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNMultiByte, open_iconv_wcstombs); + + /* Register converters for XlcNCharSet. This implicitly provides + * converters from and to XlcNCompoundText. */ + + _XlcSetConverter(lcd, XlcNCharSet, lcd, XlcNMultiByte, open_iconv_cstombs); + _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNCharSet, open_iconv_mbstocs); + _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNChar, open_iconv_mbtocs); + _XlcSetConverter(lcd, XlcNString, lcd, XlcNMultiByte, open_iconv_strtombs); + _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNString, open_iconv_mbstostr); + + /* Register converters for XlcNFontCharSet */ + _XlcSetConverter(lcd, XlcNMultiByte, lcd, XlcNFontCharSet, open_iconv_mbstofcs); + } + else { + _XlcDestroyLC(lcd); + return (XLCd) NULL; + } + + _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNString, open_wcstostr); + _XlcSetConverter(lcd, XlcNString, lcd, XlcNWideChar, open_strtowcs); + _XlcSetConverter(lcd, XlcNCharSet, lcd, XlcNWideChar, open_cstowcs); + _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNCharSet, open_wcstocs); + _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNChar, open_wcstocs1); + + /* Register converters for XlcNFontCharSet */ _XlcSetConverter(lcd, XlcNWideChar, lcd, XlcNFontCharSet, open_wcstofcs); _XlcAddUtf8Converters(lcd); diff -urN XFree86-4.1.0/xc/nls/Compose/Imakefile XFree86-4.1.0.gb18030/xc/nls/Compose/Imakefile --- XFree86-4.1.0/xc/nls/Compose/Imakefile Fri Apr 27 05:09:40 2001 +++ XFree86-4.1.0.gb18030/xc/nls/Compose/Imakefile Wed Jun 20 12:04:34 2001 @@ -69,6 +69,7 @@ ComposeTarget(vi_VN.viscii) ComposeTarget(zh) ComposeTarget(zh_CN.gbk) +ComposeTarget(zh_CN.gb18030) ComposeTarget(zh_TW) ComposeTarget(zh_TW.big5) diff -urN XFree86-4.1.0/xc/nls/Compose/zh_CN.gb18030 XFree86-4.1.0.gb18030/xc/nls/Compose/zh_CN.gb18030 --- XFree86-4.1.0/xc/nls/Compose/zh_CN.gb18030 Thu Jan 1 08:00:00 1970 +++ XFree86-4.1.0.gb18030/xc/nls/Compose/zh_CN.gb18030 Wed Jun 20 12:04:02 2001 @@ -0,0 +1,15 @@ +# +# zh_CN.GB18030 Compose Sequence +# +# Sequence Definition +# +# $XFree86: xc/nls/Compose/zh_CN.gbk,v 1.1 1999/08/28 09:00:40 dawes Exp $ +# +# This file currently has no entries. It appears that a compose file (even +# just an empty one) is required for the appropriate keysyms to work for +# this encoding. +# +# <Multi_key> Means <Compose> +# Special Character + +# End of Sequence Definition diff -urN XFree86-4.1.0/xc/nls/XLC_LOCALE/Imakefile XFree86-4.1.0.gb18030/xc/nls/XLC_LOCALE/Imakefile --- XFree86-4.1.0/xc/nls/XLC_LOCALE/Imakefile Wed Mar 7 02:54:45 2001 +++ XFree86-4.1.0.gb18030/xc/nls/XLC_LOCALE/Imakefile Wed Jun 20 12:00:42 2001 @@ -86,6 +86,7 @@ LTarget(vi_VN.viscii) LTarget(zh) LTarget(zh_CN.gbk) +LTarget(zh_CN.gb18030) LTarget(zh_HK.big5hkscs) LTarget(zh_TW) LTarget(zh_TW.big5) diff -urN XFree86-4.1.0/xc/nls/XLC_LOCALE/zh_CN.gb18030 XFree86-4.1.0.gb18030/xc/nls/XLC_LOCALE/zh_CN.gb18030 --- XFree86-4.1.0/xc/nls/XLC_LOCALE/zh_CN.gb18030 Thu Jan 1 08:00:00 1970 +++ XFree86-4.1.0.gb18030/xc/nls/XLC_LOCALE/zh_CN.gb18030 Wed Jun 20 12:00:30 +2001 @@ -0,0 +1,77 @@ +XCOMM XFree86 NLS for Chinese encoding GB18030 +XCOMM Modified from xc/nls/XLC_LOCALE/en_US.UTF-8 +XCOMM by James Su <[EMAIL PROTECTED]> + +XCOMM +XCOMM XLC_FONTSET category +XCOMM +XLC_FONTSET + +on_demand_loading True + +object_name generic + +XCOMM We leave the legacy encodings in for the moment, because we don't +XCOMM have that many ISO10646 fonts yet. +XCOMM fs0 class (7 bit ASCII) +fs0 { + charset { + name ISO8859-1:GL + } + font { + primary ISO8859-1:GL + vertical_rotate all + } +} + +XCOMM fs1 class (Chinese Han Character) +fs1 { + charset { + name GB2312.1980-0:GL + } + font { + primary GB2312.1980-0:GL + } +} + +XCOMM fs2 class +fs2 { + charset { + name ISO10646-1 + } + font { + primary ISO10646-1 + } +} +END XLC_FONTSET + +XCOMM +XCOMM XLC_XLOCALE category +XCOMM +XLC_XLOCALE + +encoding_name GB18030 +mb_cur_max 4 +state_depend_encoding False + +XCOMM cs0 class +cs0 { + side GL:Default + length 1 + ct_encoding ISO8859-1:GL +} + +XCOMM cs1 class +cs1 { + side GR + length 2 + ct_encoding GB2312.1980-0:GL; GB2312.1980-0:GR +} + +XCOMM cs2 class +cs2 { + side none + ct_encoding ISO10646-1 +} + +END XLC_XLOCALE diff -urN XFree86-4.1.0/xc/nls/compose.dir XFree86-4.1.0.gb18030/xc/nls/compose.dir --- XFree86-4.1.0/xc/nls/compose.dir Sat Apr 7 02:16:27 2001 +++ XFree86-4.1.0.gb18030/xc/nls/compose.dir Wed Jun 20 12:03:37 2001 @@ -208,6 +208,7 @@ zh/Compose zh_CN.eucCN zh/Compose zh_CN.GB2312 zh_CN.gbk/Compose zh_CN.GBK +zh_CN.gb18030/Compose zh_CN.GB18030 zh_TW.big5/Compose zh_TW.big5 zh_TW.big5/Compose zh_TW.Big5 zh_TW/Compose zh_TW.eucTW @@ -414,6 +415,7 @@ zh/Compose: zh_CN.eucCN zh/Compose: zh_CN.GB2312 zh_CN.gbk/Compose: zh_CN.GBK +zh_CN.gb18030/Compose: zh_CN.GB18030 zh_TW.big5/Compose: zh_TW.big5 zh_TW.big5/Compose: zh_TW.Big5 zh_TW/Compose: zh_TW.eucTW diff -urN XFree86-4.1.0/xc/nls/locale.alias XFree86-4.1.0.gb18030/xc/nls/locale.alias --- XFree86-4.1.0/xc/nls/locale.alias Wed May 30 06:48:34 2001 +++ XFree86-4.1.0.gb18030/xc/nls/locale.alias Wed Jun 20 12:02:56 2001 @@ -498,6 +498,7 @@ zh_CN.euc zh_CN.eucCN zh_CN.gb2312 zh_CN.eucCN zh_CN.gbk zh_CN.GBK +zh_CN.gb18030 zh_CN.GB18030 zh_TW zh_TW.big5 zh_TW.EUC zh_TW.eucTW zh_TW.euc zh_TW.eucTW @@ -1188,6 +1189,7 @@ zh_CN.euc: zh_CN.eucCN zh_CN.gb2312: zh_CN.eucCN zh_CN.gbk: zh_CN.GBK +zh_CN.gb18030: zh_CN.GB18030 zh_TW: zh_TW.big5 zh_TW.EUC: zh_TW.eucTW zh_TW.euc: zh_TW.eucTW diff -urN XFree86-4.1.0/xc/nls/locale.dir XFree86-4.1.0.gb18030/xc/nls/locale.dir --- XFree86-4.1.0/xc/nls/locale.dir Wed May 30 06:48:34 2001 +++ XFree86-4.1.0.gb18030/xc/nls/locale.dir Wed Jun 20 12:02:27 2001 @@ -207,6 +207,7 @@ zh/XLC_LOCALE zh_CN.eucCN zh/XLC_LOCALE zh_CN.GB2312 zh_CN.gbk/XLC_LOCALE zh_CN.GBK +zh_CN.gb18030/XLC_LOCALE zh_CN.GB18030 zh_HK.big5hkscs/XLC_LOCALE zh_HK.big5hkscs zh_TW.big5/XLC_LOCALE zh_TW.big5 zh_TW.big5/XLC_LOCALE zh_TW.Big5 @@ -553,6 +554,7 @@ zh/XLC_LOCALE: zh_CN.eucCN zh/XLC_LOCALE: zh_CN.GB2312 zh_CN.gbk/XLC_LOCALE: zh_CN.GBK +zh_CN.gb18030/XLC_LOCALE: zh_CN.GB18030 zh_HK.big5hkscs/XLC_LOCALE: zh_HK.big5hkscs zh_TW.big5/XLC_LOCALE: zh_TW.big5 zh_TW.big5/XLC_LOCALE: zh_TW.Big5