diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-06-06 12:55:46 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-06-06 12:55:46 +0000 |
commit | 601d294296e1de9fc423700db00bccc04a2bf50d (patch) | |
tree | 1d274eb4e512431b042e07bf8f8ff4a980407257 /localedata/gen-unicode-ctype.c | |
parent | 9a1f675436c5622b7846faa25274a2ef2d743285 (diff) |
Update.
2001-06-04 Bruno Haible <haible@clisp.cons.org>
* iconv/loop.c (UNICODE_TAG_HANDLER): New macro.
* iconv/gconv_simple.c (__gconv_transform_internal_ascii): Invoke
UNICODE_TAG_HANDLER.
(__gconv_transform_internal_ucs2): Likewise.
(__gconv_transform_internal_ucs2reverse): Likewise.
* iconvdata/8bit-gap.c (BODY for TO_LOOP): Invoke UNICODE_TAG_HANDLER.
* iconvdata/8bit-generic.c (BODY for TO_LOOP): Likewise.
* iconvdata/ansi_x3.110.c (BODY for TO_LOOP): Likewise.
* iconvdata/big5.c (BODY for TO_LOOP): Likewise.
* iconvdata/big5hkscs.c (BODY for TO_LOOP): Likewise.
* iconvdata/cp1255.c (BODY for TO_LOOP): Likewise.
* iconvdata/cp1258.c (BODY for TO_LOOP): Likewise.
* iconvdata/euc-cn.c (BODY for TO_LOOP): Likewise.
* iconvdata/euc-jp.c (BODY for TO_LOOP): Likewise.
* iconvdata/euc-kr.c (BODY for TO_LOOP): Likewise.
* iconvdata/euc-tw.c (BODY for TO_LOOP): Likewise.
* iconvdata/gbk.c (BODY for TO_LOOP): Likewise.
* iconvdata/ibm930.c (BODY for TO_LOOP): Likewise.
* iconvdata/ibm932.c (BODY for TO_LOOP): Likewise.
* iconvdata/ibm933.c (BODY for TO_LOOP): Likewise.
* iconvdata/ibm935.c (BODY for TO_LOOP): Likewise.
* iconvdata/ibm937.c (BODY for TO_LOOP): Likewise.
* iconvdata/ibm939.c (BODY for TO_LOOP): Likewise.
* iconvdata/ibm943.c (BODY for TO_LOOP): Likewise.
* iconvdata/iso646.c (BODY for TO_LOOP): Likewise.
* iconvdata/iso8859-1.c (BODY for TO_LOOP): Likewise.
* iconvdata/iso_6937.c (BODY for TO_LOOP): Likewise.
* iconvdata/iso_6937-2.c (BODY for TO_LOOP): Likewise.
* iconvdata/iso-2022-cn.c (BODY for TO_LOOP): Likewise.
* iconvdata/iso-2022-cn-ext.c (BODY for TO_LOOP): Likewise.
* iconvdata/iso-2022-kr.c (BODY for TO_LOOP): Likewise.
* iconvdata/johab.c (BODY for TO_LOOP): Likewise.
* iconvdata/sjis.c (BODY for TO_LOOP): Likewise.
* iconvdata/t.61.c (BODY for TO_LOOP): Likewise.
* iconvdata/uhc.c (BODY for TO_LOOP): Likewise.
* iconvdata/unicode.c (BODY for TO_LOOP): Likewise.
* iconvdata/iso-2022-jp.c (TAG_none, TAG_language, TAG_language_j,
TAG_language_ja, TAG_language_k, TAG_language_ko, TAG_language_z,
TAG_language_zh, CURRENT_TAG_MASK): New enum values.
(EMIT_SHIFT_TO_INIT): Don't emit an escape sequence if ASCII_set
is already selected but set2 or tag are set.
(conversion): New enum type.
(cvlist_t): New type.
(CVLIST, CVLIST_FIRST, CVLIST_REST): New macros.
(conversion_lists): New array.
(BODY for TO_LOOP): Keep track of Unicode 3.1 language tag. If "ja",
prefer conversion to Japanese character sets. If "zh", prefer
conversion to GB2312. If "ko", prefer conversion to KSC5601. Small
optimizations.
(INIT_PARAMS): Add tag.
(UPDATE_PARAMS): Add tag.
2001-06-04 Bruno Haible <haible@clisp.cons.org>
* locale/programs/locfile.c (write_locale_data): Before creat(),
unlink the file, to avoid crashing the processes that mmap it. Change
a double slash to a single slash. Free fname in case of error return.
2001-06-02 Jakub Jelinek <jakub@redhat.com>
* sysdeps/i386/fpu/s_frexpl.S (__frexpl): Mostly revert 2000-12-03
changes, do the special handling for denormal numbers, not for
normalized numbers (patch by <trevin@xmission.com>).
* math/test-misc.c (main): Test frexpl with denormal arguments.
2001-06-04 Jakub Jelinek <jakub@redhat.com>
* math/libm-test.inc (llround_test): Add two new llround tests.
* sysdeps/ieee754/ldbl-96/s_llroundl.c (__llroundl): Don't allow
overflow when rounding away from zero.
2001-06-04 Jakub Jelinek <jakub@redhat.com>
* math/Makefile (libm-calls): Add e_log2, w_log2, remove s_log2.
* math/math_private.h (__ieee754_log2, __ieee754_log2f,
__ieee754_log2l): New prototypes.
* sysdeps/generic/w_log2.c: New file.
* sysdeps/generic/w_log2f.c: New file.
* sysdeps/generic/w_log2l.c: New file.
* sysdeps/generic/s_log2l.c: Move...
* sysdeps/generic/e_log2l.c: ...to here. Rename to __ieee754_log2l.
* sysdeps/ieee754/k_standard.c (__kernel_standard): Handle log2(0)
and log2(x < 0).
* sysdeps/i386/fpu/s_log2.S: Move...
* sysdeps/i386/fpu/e_log2.S: ...to here. Rename to __ieee754_log2.
* sysdeps/i386/fpu/s_log2f.S: Move...
* sysdeps/i386/fpu/e_log2f.S: ...to here. Rename to __ieee754_log2f.
* sysdeps/i386/fpu/s_log2l.S: Move...
* sysdeps/i386/fpu/e_log2l.S: ...to here. Rename to __ieee754_log2l.
* sysdeps/m68k/fpu/s_log2.S: Move...
* sysdeps/m68k/fpu/e_log2.S: ...to here. Rename to __ieee754_log2.
* sysdeps/m68k/fpu/s_log2f.S: Move...
* sysdeps/m68k/fpu/e_log2f.S: ...to here. Rename to __ieee754_log2f.
* sysdeps/m68k/fpu/s_log2l.S: Move...
* sysdeps/m68k/fpu/e_log2l.S: ...to here. Rename to __ieee754_log2l.
* sysdeps/ieee754/dbl-64/s_log2.c: Move...
* sysdeps/ieee754/dbl-64/e_log2.c: ...to here. Rename to
__ieee754_log2.
* sysdeps/ieee754/flt-32/s_log2f.c: Move...
* sysdeps/ieee754/flt-32/e_log2f.c: ...to here. Rename to
__ieee754_log2f.
2001-06-04 Jakub Jelinek <jakub@redhat.com>
* sysdeps/generic/w_exp2.c (u_threshold): Lower threshold so that
even arguments which result in denormalized exp2 are accepted.
(__exp2): Arguments equal to u_threshold already result into
underflow.
* sysdeps/generic/w_exp2f.c (u_threshold, __exp2f): Likewise.
* sysdeps/generic/w_exp2l.c (u_threshold, __exp2l): Likewise.
* sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Lomark was too
low, with corrected lowmark use greaterequal, not greater.
* sysdeps/ieee754/flt-32/e_exp2f.c (__ieee754_exp2f): Likewise.
2001-06-04 Jakub Jelinek <jakub@redhat.com>
* math/libm-test.inc (ilogb_test): Test that ilogb(+-Inf) == INT_MAX.
* sysdeps/i386/fpu/s_ilogb.S (__ilogb): Return INT_MAX for +-Inf.
* sysdeps/i386/fpu/s_ilogbf.S (__ilogbf): Likewise.
* sysdeps/i386/fpu/s_ilogbl.S (__ilogbl): Likewise.
* sysdeps/ieee754/dbl-64/s_ilogb.c (__ilogb): Likewise.
* sysdeps/ieee754/flt-32/s_ilogbf.c (__ilogbf): Likewise.
* sysdeps/ieee754/ldbl-128/s_ilogbl.c (__ilogbl): Likewise.
* sysdeps/ieee754/ldbl-96/s_ilogbl.c (__ilogbl): Likewise.
2001-06-04 Jakub Jelinek <jakub@redhat.com>
* sysdeps/generic/w_coshl.c (__coshl): Test if finite argument
gave non-finite result instead of using constant in generic
version.
* sysdeps/generic/w_coshf.c (__coshf): Likewise.
* sysdeps/generic/w_cosh.c (__cosh): Likewise.
* sysdeps/generic/w_exp10.c (o_threshold, u_threshold): Remove.
(__exp10): Test if finite argument gave non-finite result.
* sysdeps/generic/w_exp10f.c (o_threshold, u_threshold, __exp10f):
Likewise.
* sysdeps/generic/w_exp10l.c (o_threshold, u_threshold, __exp10l):
Likewise.
2001-06-04 Jakub Jelinek <jakub@redhat.com>
* sysdeps/ieee754/ldbl-96/e_coshl.c (__ieee754_coshl): Fix
overflow threshold constant (log(LDBL_MAX)+M_LN2l).
2001-05-29 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (idx_table): New struct type.
(idx_table_init, idx_table_get, idx_table_add): New functions.
(MAX_CHARNAMES_IDX): Remove macro.
(locale_ctype_t): Change type of charnames_idx field.
(ctype_startup): Change initialization of charnames_idx field.
(find_idx): Use idx_table_get and idx_table_add for speed.
* locale/programs/charmap.c (charmap_new_char): Fix ucs4 value
computation of characters in a range.
2001-05-29 Bruno Haible <haible@clisp.cons.org>
* iconvdata/gb18030.c (__fourbyte_to_ucs1): Add mappings for <U03F4>,
<U03F5>.
(__ucs_to_gb18030_tab1): Likewise.
(BODY for FROM_LOOP): Add mapping for <U00010000>..<U0010FFFF>.
(BODY for TO_LOOP): Likewise.
* iconvdata/tst-table-charmap.sh: Update for charmaps containing
<U00xxxxxx> syntax.
* iconvdata/tst-table-from.c (bmp_only): New variable.
(utf8_decode): If bmp_only, don't return characters outside Unicode
plane 0.
(main): When testing UTF-8 or GB18030, set bmp_only to 1. Don't print
a conversion line if utf8_decode returns NULL.
* iconvdata/tst-table-to.c (main): When testing encodings other than
UTF-8 and GB18030, loop upto U+30000 instead of U+10000. Use UTF-8
instead of UCS-2 as input.
* iconvdata/tst-table.sh: For GB18030, use only the part < 0x10000
of the charmap.
2001-05-29 Bruno Haible <haible@clisp.cons.org>
* iconvdata/cns11643l1.c: Update to Unicode 3.1.
(__cns11643l1_to_ucs4_tab): Regenerated.
(__cns11643l1_from_ucs4_tab12): Regenerated.
* iconvdata/cns11643.c: Update to Unicode 3.1.
(__cns11643l14_to_ucs4_tab): Remove array.
(__cns11643l3_to_ucs4_tab, __cns11643l4_to_ucs4_tab,
__cns11643l5_to_ucs4_tab, __cns11643l6_to_ucs4_tab,
__cns11643l7_to_ucs4_tab, __cns11643l15_to_ucs4_tab): New arrays.
(__cns11643_from_ucs4p0_tab): Renamed from __cns11643_from_ucs4_tab.
(__cns11643_from_ucs4p2_tab): New array.
* iconvdata/cns11643.h (__cns11643l14_to_ucs4_tab): Remove declaration.
(__cns11643l3_to_ucs4_tab, __cns11643l4_to_ucs4_tab,
__cns11643l5_to_ucs4_tab, __cns11643l6_to_ucs4_tab,
__cns11643l7_to_ucs4_tab, __cns11643l15_to_ucs4_tab): New declarations.
(cns11643_to_ucs4): Treat planes 3, 4, 5, 6, 7, 15 instead of 14.
(__cns11643_from_ucs4_tab): Remove declaration.
(__cns11643_from_ucs4p0_tab, __cns11643_from_ucs4p2_tab): New
declarations.
(ucs4_to_cns11643): Update for new arrays. Treat U+3400..U+4DFF and
U+20000..U+2A6D6.
* iconvdata/cns11643l2.h (__cns11643_from_ucs4_tab): Remove
declaration.
(__cns11643_from_ucs4p0_tab): New declaration.
(ucs4_to_cns11643l2): Update for new arrays.
* iconvdata/iso-2022-cn-ext.c (BODY for FROM_LOOP): Handle planes
3 to 7.
(BODY for TO_LOOP): Handle planes 3 to 7, instead of plane 14.
* iconvdata/EUC-TW.irreversible: New file.
* iconvdata/tst-table.sh: Use it.
* iconvdata/Makefile (distribute): Add CP1255.irreversible,
CP1258.irreversible, EUC-TW.irreversible.
2001-05-29 Bruno Haible <haible@clisp.cons.org>
* locale/C-translit.h.in: Add transliterations for new Unicode 3.1
mathematical symbols.
Diffstat (limited to 'localedata/gen-unicode-ctype.c')
-rw-r--r-- | localedata/gen-unicode-ctype.c | 225 |
1 files changed, 93 insertions, 132 deletions
diff --git a/localedata/gen-unicode-ctype.c b/localedata/gen-unicode-ctype.c index 1259aef872..70bea4172d 100644 --- a/localedata/gen-unicode-ctype.c +++ b/localedata/gen-unicode-ctype.c @@ -1,5 +1,5 @@ /* Generate a Unicode conforming LC_CTYPE category from a UnicodeData file. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000-2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Bruno Haible <haible@clisp.cons.org>, 2000. @@ -19,9 +19,7 @@ Boston, MA 02111-1307, USA. */ /* Usage example: - $ gen-unicode /usr/local/share/Unidata/UnicodeData.txt \ - /usr/local/share/Unidata/PropList.txt \ - 3.0 + $ gen-unicode /usr/local/share/Unidata/UnicodeData.txt 3.1 */ #include <stdio.h> @@ -54,7 +52,7 @@ struct unicode_attribute #define NONE (~(unsigned int)0) /* The entire contents of the UnicodeData.txt file. */ -struct unicode_attribute unicode_attributes [0x10000]; +struct unicode_attribute unicode_attributes [0x110000]; /* Stores in unicode_attributes[i] the values from the given fields. */ static void @@ -69,11 +67,14 @@ fill_attribute (unsigned int i, { struct unicode_attribute * uni; - if (i >= 0x10000) + if (i >= 0x110000) { fprintf (stderr, "index too large\n"); exit (1); } + if (strcmp (field2, "Cs") == 0) + /* Surrogates are UTF-16 artefacts, not real characters. Ignore them. */ + return; uni = &unicode_attributes[i]; /* Copy the strings. */ uni->name = strdup (field1); @@ -151,7 +152,7 @@ fill_attributes (const char *unicodedata_filename) char field14[FIELDLEN]; int lineno = 0; - for (i = 0; i < 0x10000; i++) + for (i = 0; i < 0x110000; i++) unicode_attributes[i].name = NULL; stream = fopen (unicodedata_filename, "r"); @@ -247,87 +248,6 @@ fill_attributes (const char *unicodedata_filename) } } -/* The combining property from the PropList.txt file. */ -char unicode_combining[0x10000]; - -/* Stores in unicode_combining[] the Combining property from the - PropList.txt file. */ -static void -fill_combining (const char *proplist_filename) -{ - unsigned int i; - FILE *stream; - char buf[100+1]; - - for (i = 0; i < 0x10000; i++) - unicode_combining[i] = 0; - - stream = fopen (proplist_filename, "r"); - if (stream == NULL) - { - fprintf (stderr, "error during fopen of '%s'\n", proplist_filename); - exit (1); - } - - /* Search for the "Property dump for: 0x20000004 (Combining)" line. */ - do - { - if (fscanf (stream, "%100[^\n]\n", buf) < 1) - { - fprintf (stderr, "no combining property found in '%s'\n", - proplist_filename); - exit (1); - } - } - while (strstr (buf, "(Combining)") == NULL); - - for (;;) - { - unsigned int i1, i2; - - if (fscanf (stream, "%100[^\n]\n", buf) < 1) - { - fprintf (stderr, "premature end of combining property in '%s'\n", - proplist_filename); - exit (1); - } - if (buf[0] == '*') - break; - if (strlen (buf) >= 10 && buf[4] == '.' && buf[5] == '.') - { - if (sscanf (buf, "%4X..%4X", &i1, &i2) < 2) - { - fprintf (stderr, "parse error in combining property in '%s'\n", - proplist_filename); - exit (1); - } - } - else if (strlen (buf) >= 4) - { - if (sscanf (buf, "%4X", &i1) < 1) - { - fprintf (stderr, "parse error in combining property in '%s'\n", - proplist_filename); - exit (1); - } - i2 = i1; - } - else - { - fprintf (stderr, "parse error in combining property in '%s'\n", - proplist_filename); - exit (1); - } - for (i = i1; i <= i2; i++) - unicode_combining[i] = 1; - } - if (ferror (stream) || fclose (stream)) - { - fprintf (stderr, "error reading from '%s'\n", proplist_filename); - exit (1); - } -} - /* Character mappings. */ static unsigned int @@ -380,7 +300,15 @@ static bool is_alpha (unsigned int ch) { return (unicode_attributes[ch].name != NULL - && (unicode_attributes[ch].category[0] == 'L' + && ((unicode_attributes[ch].category[0] == 'L' + /* Theppitak Karoonboonyanan <thep@links.nectec.or.th> says + <U0E2F>, <U0E46> should belong to is_punct. */ + && (ch != 0x0E2F) && (ch != 0x0E46)) + /* Theppitak Karoonboonyanan <thep@links.nectec.or.th> says + <U0E31>, <U0E34>..<U0E3A>, <U0E47>..<U0E4E> are is_alpha. */ + || (ch == 0x0E31) + || (ch >= 0x0E34 && ch <= 0x0E3A) + || (ch >= 0x0E47 && ch <= 0x0E4E) /* Avoid warning for <U0345>. */ || (ch == 0x0345) /* Avoid warnings for <U2160>..<U217F>. */ @@ -528,8 +456,15 @@ is_punct (unsigned int ch) static bool is_combining (unsigned int ch) { + /* Up to Unicode 3.0.1 we took the Combining property from the PropList.txt + file. In 3.0.1 it was identical to the union of the general categories + "Mn", "Mc", "Me". In Unicode 3.1 this property has been dropped from the + PropList.txt file, so we take the latter definition. */ return (unicode_attributes[ch].name != NULL - && unicode_combining[ch] != 0); + && unicode_attributes[ch].category[0] == 'M' + && (unicode_attributes[ch].category[1] == 'n' + || unicode_attributes[ch].category[1] == 'c' + || unicode_attributes[ch].category[1] == 'e')); } static bool @@ -541,43 +476,65 @@ is_combining_level3 (unsigned int ch) && strtoul (unicode_attributes[ch].combining, NULL, 10) >= 200); } +/* Return the UCS symbol string for a Unicode character. */ +static const char * +ucs_symbol (unsigned int i) +{ + static char buf[11+1]; + + sprintf (buf, (i < 0x10000 ? "<U%04X>" : "<U%08X>"), i); + return buf; +} + +/* Return the UCS symbol range string for a Unicode characters interval. */ +static const char * +ucs_symbol_range (unsigned int low, unsigned int high) +{ + static char buf[24+1]; + + strcpy (buf, ucs_symbol (low)); + strcat (buf, ".."); + strcat (buf, ucs_symbol (high)); + return buf; +} + /* Output a character class (= property) table. */ static void output_charclass (FILE *stream, const char *classname, bool (*func) (unsigned int)) { - char table[0x10000]; + char table[0x110000]; unsigned int i; bool need_semicolon; const int max_column = 75; int column; - for (i = 0; i < 0x10000; i++) + for (i = 0; i < 0x110000; i++) table[i] = (int) func (i); fprintf (stream, "%s ", classname); need_semicolon = false; column = 1000; - for (i = 0; i < 0x10000; ) + for (i = 0; i < 0x110000; ) { if (!table[i]) i++; else { unsigned int low, high; - char buf[17]; + char buf[25]; low = i; do i++; - while (i < 0x10000 && table[i]); + while (i < 0x110000 && table[i]); high = i - 1; if (low == high) - sprintf (buf, "<U%04X>", low); + strcpy (buf, ucs_symbol (low)); else - sprintf (buf, "<U%04X>..<U%04X>", low, high); + strcpy (buf, ucs_symbol_range (low, high)); if (need_semicolon) { @@ -605,24 +562,28 @@ static void output_charmap (FILE *stream, const char *mapname, unsigned int (*func) (unsigned int)) { - char table[0x10000]; + char table[0x110000]; unsigned int i; bool need_semicolon; const int max_column = 75; int column; - for (i = 0; i < 0x10000; i++) + for (i = 0; i < 0x110000; i++) table[i] = (func (i) != i); fprintf (stream, "%s ", mapname); need_semicolon = false; column = 1000; - for (i = 0; i < 0x10000; i++) + for (i = 0; i < 0x110000; i++) if (table[i]) { - char buf[18]; + char buf[25+1]; - sprintf (buf, "(<U%04X>,<U%04X>)", i, func (i)); + strcpy (buf, "("); + strcat (buf, ucs_symbol (i)); + strcat (buf, ","); + strcat (buf, ucs_symbol (func (i))); + strcat (buf, ")"); if (need_semicolon) { @@ -668,7 +629,7 @@ output_tables (const char *filename, const char *version) fprintf (stream, "escape_char /\n"); fprintf (stream, "comment_char %%\n"); fprintf (stream, "\n"); - fprintf (stream, "%% Generated automatically by gen-unicode for Unicode %s.\n", + fprintf (stream, "%% Generated automatically by gen-unicode-ctype for Unicode %s.\n", version); fprintf (stream, "\n"); @@ -690,76 +651,76 @@ output_tables (const char *filename, const char *version) strftime (date, sizeof (date), "%Y-%m-%d", gmtime (&now)); fprintf (stream, "date \"%s\"\n", date); } - fprintf (stream, "category \"unicode:2000\";LC_CTYPE\n"); + fprintf (stream, "category \"unicode:2001\";LC_CTYPE\n"); fprintf (stream, "END LC_IDENTIFICATION\n"); fprintf (stream, "\n"); /* Verifications. */ - for (ch = 0; ch < 0x10000; ch++) + for (ch = 0; ch < 0x110000; ch++) { /* toupper restriction: "Only characters specified for the keywords lower and upper shall be specified. */ if (to_upper (ch) != ch && !(is_lower (ch) || is_upper (ch))) fprintf (stderr, - "<U%04X> is not upper|lower but toupper(0x%04X) = 0x%04X\n", - ch, ch, to_upper (ch)); + "%s is not upper|lower but toupper(0x%04X) = 0x%04X\n", + ucs_symbol (ch), ch, to_upper (ch)); /* tolower restriction: "Only characters specified for the keywords lower and upper shall be specified. */ if (to_lower (ch) != ch && !(is_lower (ch) || is_upper (ch))) fprintf (stderr, - "<U%04X> is not upper|lower but tolower(0x%04X) = 0x%04X\n", - ch, ch, to_lower (ch)); + "%s is not upper|lower but tolower(0x%04X) = 0x%04X\n", + ucs_symbol (ch), ch, to_lower (ch)); /* alpha restriction: "Characters classified as either upper or lower shall automatically belong to this class. */ if ((is_lower (ch) || is_upper (ch)) && !is_alpha (ch)) - fprintf (stderr, "<U%04X> is upper|lower but not alpha\n", ch); + fprintf (stderr, "%s is upper|lower but not alpha\n", ucs_symbol (ch)); /* alpha restriction: "No character specified for the keywords cntrl, digit, punct or space shall be specified." */ if (is_alpha (ch) && is_cntrl (ch)) - fprintf (stderr, "<U%04X> is alpha and cntrl\n", ch); + fprintf (stderr, "%s is alpha and cntrl\n", ucs_symbol (ch)); if (is_alpha (ch) && is_digit (ch)) - fprintf (stderr, "<U%04X> is alpha and digit\n", ch); + fprintf (stderr, "%s is alpha and digit\n", ucs_symbol (ch)); if (is_alpha (ch) && is_punct (ch)) - fprintf (stderr, "<U%04X> is alpha and punct\n", ch); + fprintf (stderr, "%s is alpha and punct\n", ucs_symbol (ch)); if (is_alpha (ch) && is_space (ch)) - fprintf (stderr, "<U%04X> is alpha and space\n", ch); + fprintf (stderr, "%s is alpha and space\n", ucs_symbol (ch)); /* space restriction: "No character specified for the keywords upper, lower, alpha, digit, graph or xdigit shall be specified." upper, lower, alpha already checked above. */ if (is_space (ch) && is_digit (ch)) - fprintf (stderr, "<U%04X> is space and digit\n", ch); + fprintf (stderr, "%s is space and digit\n", ucs_symbol (ch)); if (is_space (ch) && is_graph (ch)) - fprintf (stderr, "<U%04X> is space and graph\n", ch); + fprintf (stderr, "%s is space and graph\n", ucs_symbol (ch)); if (is_space (ch) && is_xdigit (ch)) - fprintf (stderr, "<U%04X> is space and xdigit\n", ch); + fprintf (stderr, "%s is space and xdigit\n", ucs_symbol (ch)); /* cntrl restriction: "No character specified for the keywords upper, lower, alpha, digit, punct, graph, print or xdigit shall be specified." upper, lower, alpha already checked above. */ if (is_cntrl (ch) && is_digit (ch)) - fprintf (stderr, "<U%04X> is cntrl and digit\n", ch); + fprintf (stderr, "%s is cntrl and digit\n", ucs_symbol (ch)); if (is_cntrl (ch) && is_punct (ch)) - fprintf (stderr, "<U%04X> is cntrl and punct\n", ch); + fprintf (stderr, "%s is cntrl and punct\n", ucs_symbol (ch)); if (is_cntrl (ch) && is_graph (ch)) - fprintf (stderr, "<U%04X> is cntrl and graph\n", ch); + fprintf (stderr, "%s is cntrl and graph\n", ucs_symbol (ch)); if (is_cntrl (ch) && is_print (ch)) - fprintf (stderr, "<U%04X> is cntrl and print\n", ch); + fprintf (stderr, "%s is cntrl and print\n", ucs_symbol (ch)); if (is_cntrl (ch) && is_xdigit (ch)) - fprintf (stderr, "<U%04X> is cntrl and xdigit\n", ch); + fprintf (stderr, "%s is cntrl and xdigit\n", ucs_symbol (ch)); /* punct restriction: "No character specified for the keywords upper, lower, alpha, digit, cntrl, xdigit or as the <space> character shall be specified." upper, lower, alpha, cntrl already checked above. */ if (is_punct (ch) && is_digit (ch)) - fprintf (stderr, "<U%04X> is punct and digit\n", ch); + fprintf (stderr, "%s is punct and digit\n", ucs_symbol (ch)); if (is_punct (ch) && is_xdigit (ch)) - fprintf (stderr, "<U%04X> is punct and xdigit\n", ch); + fprintf (stderr, "%s is punct and xdigit\n", ucs_symbol (ch)); if (is_punct (ch) && (ch == 0x0020)) - fprintf (stderr, "<U%04X> is punct\n", ch); + fprintf (stderr, "%s is punct\n", ucs_symbol (ch)); /* graph restriction: "No character specified for the keyword cntrl shall be specified." Already checked above. */ @@ -772,9 +733,11 @@ output_tables (const char *filename, const char *version) I think susv2/xbd/locale.html should speak of "space characters", not "space character". */ if (is_print (ch) && !(is_graph (ch) || /* ch == 0x0020 */ is_space (ch))) - fprintf (stderr, "<U%04X> is print but not graph|<space>\n", ch); + fprintf (stderr, + "%s is print but not graph|<space>\n", ucs_symbol (ch)); if (!is_print (ch) && (is_graph (ch) || ch == 0x0020)) - fprintf (stderr, "<U%04X> is graph|<space> but not print\n", ch); + fprintf (stderr, + "%s is graph|<space> but not print\n", ucs_symbol (ch)); } fprintf (stream, "LC_CTYPE\n"); @@ -808,17 +771,15 @@ output_tables (const char *filename, const char *version) int main (int argc, char * argv[]) { - if (argc != 4) + if (argc != 3) { - fprintf (stderr, "Usage: %s UnicodeData.txt PropList.txt version\n", - argv[0]); + fprintf (stderr, "Usage: %s UnicodeData.txt version\n", argv[0]); exit (1); } fill_attributes (argv[1]); - fill_combining (argv[2]); - output_tables ("unicode", argv[3]); + output_tables ("unicode", argv[2]); return 0; } |