Commit 4f96a13c authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Use G_N_ELEMENTS rather than a custom macro.

Sun Jul  1 20:16:25 2001  Owen Taylor  <otaylor@redhat.com>

	* glib/guniprop.c (g_unichar_totitle): Use G_N_ELEMENTS
	rather than a custom macro.

	* glib/gen-unicode-tables.pl: Adapt to changes in table
	formats for Unicode 3.1

	* glib/gunicode.h glib/guniprop.c glib/gunichartables.h
	  glib/gen-unicode-tables.pl: Add case conversion functions
        g_utf8_casefold, g_utf8_strup, g_utf8_strdown.

	* tests/unicode-caseconv.c tests/gen-casefold-txt.pl
	  tests/gen-casemap-txt.pl tests/casefold.txt
	  tests/casemap.txt: Test cases for case conversion.

	* glib/gunicode.h glib/gunidecomp.[ch] glib/gunicomp.h
	  glib/gen-unicode-tables.pl: Add function to do Unicode
        normalization g_utf8_normalize().

	* tests/unicode-normalize.c: Test program for case conversion.

	* glib/gunicode.h glib/gunicollate.c: Add collation functions
	g_utf8_collate, g_utf8_collate_key.

	* test/unicode-collate.c: Test program for collation.

	* glib/gdate.c (g_date_fill_parse_tokens): Fix uninitialized
	variable.

	* glib/gdate.c (g_date_strftime) docs/Changes-2.0.txt:
	Make work with UTF-8 even if the locale isn't UTF-8 based.
	Still somewhat of broken, if the format string contains
	characters not representable in the current locale, will warn
	and not work.

	* glib/gdate.c: Use UTF-8 normalization and casefolding.
parent b37e7bbb
Sun Jul 1 20:16:25 2001 Owen Taylor <otaylor@redhat.com>
* glib/guniprop.c (g_unichar_totitle): Use G_N_ELEMENTS
rather than a custom macro.
* glib/gen-unicode-tables.pl: Adapt to changes in table
formats for Unicode 3.1
* glib/gunicode.h glib/guniprop.c glib/gunichartables.h
glib/gen-unicode-tables.pl: Add case conversion functions
g_utf8_casefold, g_utf8_strup, g_utf8_strdown.
* tests/unicode-caseconv.c tests/gen-casefold-txt.pl
tests/gen-casemap-txt.pl tests/casefold.txt
tests/casemap.txt: Test cases for case conversion.
* glib/gunicode.h glib/gunidecomp.[ch] glib/gunicomp.h
glib/gen-unicode-tables.pl: Add function to do Unicode
normalization g_utf8_normalize().
* tests/unicode-normalize.c: Test program for case conversion.
* glib/gunicode.h glib/gunicollate.c: Add collation functions
g_utf8_collate, g_utf8_collate_key.
* test/unicode-collate.c: Test program for collation.
* glib/gdate.c (g_date_fill_parse_tokens): Fix uninitialized
variable.
* glib/gdate.c (g_date_strftime) docs/Changes-2.0.txt:
Make work with UTF-8 even if the locale isn't UTF-8 based.
Still somewhat of broken, if the format string contains
characters not representable in the current locale, will warn
and not work.
* glib/gdate.c: Use UTF-8 normalization and casefolding.
Sat Jun 30 16:03:16 2001 Owen Taylor <otaylor@redhat.com>
* glib/giowin32.c glib/giounix.c glib/gmain.[ch]:
......
Sun Jul 1 20:16:25 2001 Owen Taylor <otaylor@redhat.com>
* glib/guniprop.c (g_unichar_totitle): Use G_N_ELEMENTS
rather than a custom macro.
* glib/gen-unicode-tables.pl: Adapt to changes in table
formats for Unicode 3.1
* glib/gunicode.h glib/guniprop.c glib/gunichartables.h
glib/gen-unicode-tables.pl: Add case conversion functions
g_utf8_casefold, g_utf8_strup, g_utf8_strdown.
* tests/unicode-caseconv.c tests/gen-casefold-txt.pl
tests/gen-casemap-txt.pl tests/casefold.txt
tests/casemap.txt: Test cases for case conversion.
* glib/gunicode.h glib/gunidecomp.[ch] glib/gunicomp.h
glib/gen-unicode-tables.pl: Add function to do Unicode
normalization g_utf8_normalize().
* tests/unicode-normalize.c: Test program for case conversion.
* glib/gunicode.h glib/gunicollate.c: Add collation functions
g_utf8_collate, g_utf8_collate_key.
* test/unicode-collate.c: Test program for collation.
* glib/gdate.c (g_date_fill_parse_tokens): Fix uninitialized
variable.
* glib/gdate.c (g_date_strftime) docs/Changes-2.0.txt:
Make work with UTF-8 even if the locale isn't UTF-8 based.
Still somewhat of broken, if the format string contains
characters not representable in the current locale, will warn
and not work.
* glib/gdate.c: Use UTF-8 normalization and casefolding.
Sat Jun 30 16:03:16 2001 Owen Taylor <otaylor@redhat.com>
* glib/giowin32.c glib/giounix.c glib/gmain.[ch]:
......
Sun Jul 1 20:16:25 2001 Owen Taylor <otaylor@redhat.com>
* glib/guniprop.c (g_unichar_totitle): Use G_N_ELEMENTS
rather than a custom macro.
* glib/gen-unicode-tables.pl: Adapt to changes in table
formats for Unicode 3.1
* glib/gunicode.h glib/guniprop.c glib/gunichartables.h
glib/gen-unicode-tables.pl: Add case conversion functions
g_utf8_casefold, g_utf8_strup, g_utf8_strdown.
* tests/unicode-caseconv.c tests/gen-casefold-txt.pl
tests/gen-casemap-txt.pl tests/casefold.txt
tests/casemap.txt: Test cases for case conversion.
* glib/gunicode.h glib/gunidecomp.[ch] glib/gunicomp.h
glib/gen-unicode-tables.pl: Add function to do Unicode
normalization g_utf8_normalize().
* tests/unicode-normalize.c: Test program for case conversion.
* glib/gunicode.h glib/gunicollate.c: Add collation functions
g_utf8_collate, g_utf8_collate_key.
* test/unicode-collate.c: Test program for collation.
* glib/gdate.c (g_date_fill_parse_tokens): Fix uninitialized
variable.
* glib/gdate.c (g_date_strftime) docs/Changes-2.0.txt:
Make work with UTF-8 even if the locale isn't UTF-8 based.
Still somewhat of broken, if the format string contains
characters not representable in the current locale, will warn
and not work.
* glib/gdate.c: Use UTF-8 normalization and casefolding.
Sat Jun 30 16:03:16 2001 Owen Taylor <otaylor@redhat.com>
* glib/giowin32.c glib/giounix.c glib/gmain.[ch]:
......
Sun Jul 1 20:16:25 2001 Owen Taylor <otaylor@redhat.com>
* glib/guniprop.c (g_unichar_totitle): Use G_N_ELEMENTS
rather than a custom macro.
* glib/gen-unicode-tables.pl: Adapt to changes in table
formats for Unicode 3.1
* glib/gunicode.h glib/guniprop.c glib/gunichartables.h
glib/gen-unicode-tables.pl: Add case conversion functions
g_utf8_casefold, g_utf8_strup, g_utf8_strdown.
* tests/unicode-caseconv.c tests/gen-casefold-txt.pl
tests/gen-casemap-txt.pl tests/casefold.txt
tests/casemap.txt: Test cases for case conversion.
* glib/gunicode.h glib/gunidecomp.[ch] glib/gunicomp.h
glib/gen-unicode-tables.pl: Add function to do Unicode
normalization g_utf8_normalize().
* tests/unicode-normalize.c: Test program for case conversion.
* glib/gunicode.h glib/gunicollate.c: Add collation functions
g_utf8_collate, g_utf8_collate_key.
* test/unicode-collate.c: Test program for collation.
* glib/gdate.c (g_date_fill_parse_tokens): Fix uninitialized
variable.
* glib/gdate.c (g_date_strftime) docs/Changes-2.0.txt:
Make work with UTF-8 even if the locale isn't UTF-8 based.
Still somewhat of broken, if the format string contains
characters not representable in the current locale, will warn
and not work.
* glib/gdate.c: Use UTF-8 normalization and casefolding.
Sat Jun 30 16:03:16 2001 Owen Taylor <otaylor@redhat.com>
* glib/giowin32.c glib/giounix.c glib/gmain.[ch]:
......
Sun Jul 1 20:16:25 2001 Owen Taylor <otaylor@redhat.com>
* glib/guniprop.c (g_unichar_totitle): Use G_N_ELEMENTS
rather than a custom macro.
* glib/gen-unicode-tables.pl: Adapt to changes in table
formats for Unicode 3.1
* glib/gunicode.h glib/guniprop.c glib/gunichartables.h
glib/gen-unicode-tables.pl: Add case conversion functions
g_utf8_casefold, g_utf8_strup, g_utf8_strdown.
* tests/unicode-caseconv.c tests/gen-casefold-txt.pl
tests/gen-casemap-txt.pl tests/casefold.txt
tests/casemap.txt: Test cases for case conversion.
* glib/gunicode.h glib/gunidecomp.[ch] glib/gunicomp.h
glib/gen-unicode-tables.pl: Add function to do Unicode
normalization g_utf8_normalize().
* tests/unicode-normalize.c: Test program for case conversion.
* glib/gunicode.h glib/gunicollate.c: Add collation functions
g_utf8_collate, g_utf8_collate_key.
* test/unicode-collate.c: Test program for collation.
* glib/gdate.c (g_date_fill_parse_tokens): Fix uninitialized
variable.
* glib/gdate.c (g_date_strftime) docs/Changes-2.0.txt:
Make work with UTF-8 even if the locale isn't UTF-8 based.
Still somewhat of broken, if the format string contains
characters not representable in the current locale, will warn
and not work.
* glib/gdate.c: Use UTF-8 normalization and casefolding.
Sat Jun 30 16:03:16 2001 Owen Taylor <otaylor@redhat.com>
* glib/giowin32.c glib/giounix.c glib/gmain.[ch]:
......
Sun Jul 1 20:16:25 2001 Owen Taylor <otaylor@redhat.com>
* glib/guniprop.c (g_unichar_totitle): Use G_N_ELEMENTS
rather than a custom macro.
* glib/gen-unicode-tables.pl: Adapt to changes in table
formats for Unicode 3.1
* glib/gunicode.h glib/guniprop.c glib/gunichartables.h
glib/gen-unicode-tables.pl: Add case conversion functions
g_utf8_casefold, g_utf8_strup, g_utf8_strdown.
* tests/unicode-caseconv.c tests/gen-casefold-txt.pl
tests/gen-casemap-txt.pl tests/casefold.txt
tests/casemap.txt: Test cases for case conversion.
* glib/gunicode.h glib/gunidecomp.[ch] glib/gunicomp.h
glib/gen-unicode-tables.pl: Add function to do Unicode
normalization g_utf8_normalize().
* tests/unicode-normalize.c: Test program for case conversion.
* glib/gunicode.h glib/gunicollate.c: Add collation functions
g_utf8_collate, g_utf8_collate_key.
* test/unicode-collate.c: Test program for collation.
* glib/gdate.c (g_date_fill_parse_tokens): Fix uninitialized
variable.
* glib/gdate.c (g_date_strftime) docs/Changes-2.0.txt:
Make work with UTF-8 even if the locale isn't UTF-8 based.
Still somewhat of broken, if the format string contains
characters not representable in the current locale, will warn
and not work.
* glib/gdate.c: Use UTF-8 normalization and casefolding.
Sat Jun 30 16:03:16 2001 Owen Taylor <otaylor@redhat.com>
* glib/giowin32.c glib/giounix.c glib/gmain.[ch]:
......
Sun Jul 1 20:16:25 2001 Owen Taylor <otaylor@redhat.com>
* glib/guniprop.c (g_unichar_totitle): Use G_N_ELEMENTS
rather than a custom macro.
* glib/gen-unicode-tables.pl: Adapt to changes in table
formats for Unicode 3.1
* glib/gunicode.h glib/guniprop.c glib/gunichartables.h
glib/gen-unicode-tables.pl: Add case conversion functions
g_utf8_casefold, g_utf8_strup, g_utf8_strdown.
* tests/unicode-caseconv.c tests/gen-casefold-txt.pl
tests/gen-casemap-txt.pl tests/casefold.txt
tests/casemap.txt: Test cases for case conversion.
* glib/gunicode.h glib/gunidecomp.[ch] glib/gunicomp.h
glib/gen-unicode-tables.pl: Add function to do Unicode
normalization g_utf8_normalize().
* tests/unicode-normalize.c: Test program for case conversion.
* glib/gunicode.h glib/gunicollate.c: Add collation functions
g_utf8_collate, g_utf8_collate_key.
* test/unicode-collate.c: Test program for collation.
* glib/gdate.c (g_date_fill_parse_tokens): Fix uninitialized
variable.
* glib/gdate.c (g_date_strftime) docs/Changes-2.0.txt:
Make work with UTF-8 even if the locale isn't UTF-8 based.
Still somewhat of broken, if the format string contains
characters not representable in the current locale, will warn
and not work.
* glib/gdate.c: Use UTF-8 normalization and casefolding.
Sat Jun 30 16:03:16 2001 Owen Taylor <otaylor@redhat.com>
* glib/giowin32.c glib/giounix.c glib/gmain.[ch]:
......
Sun Jul 1 20:16:25 2001 Owen Taylor <otaylor@redhat.com>
* glib/guniprop.c (g_unichar_totitle): Use G_N_ELEMENTS
rather than a custom macro.
* glib/gen-unicode-tables.pl: Adapt to changes in table
formats for Unicode 3.1
* glib/gunicode.h glib/guniprop.c glib/gunichartables.h
glib/gen-unicode-tables.pl: Add case conversion functions
g_utf8_casefold, g_utf8_strup, g_utf8_strdown.
* tests/unicode-caseconv.c tests/gen-casefold-txt.pl
tests/gen-casemap-txt.pl tests/casefold.txt
tests/casemap.txt: Test cases for case conversion.
* glib/gunicode.h glib/gunidecomp.[ch] glib/gunicomp.h
glib/gen-unicode-tables.pl: Add function to do Unicode
normalization g_utf8_normalize().
* tests/unicode-normalize.c: Test program for case conversion.
* glib/gunicode.h glib/gunicollate.c: Add collation functions
g_utf8_collate, g_utf8_collate_key.
* test/unicode-collate.c: Test program for collation.
* glib/gdate.c (g_date_fill_parse_tokens): Fix uninitialized
variable.
* glib/gdate.c (g_date_strftime) docs/Changes-2.0.txt:
Make work with UTF-8 even if the locale isn't UTF-8 based.
Still somewhat of broken, if the format string contains
characters not representable in the current locale, will warn
and not work.
* glib/gdate.c: Use UTF-8 normalization and casefolding.
Sat Jun 30 16:03:16 2001 Owen Taylor <otaylor@redhat.com>
* glib/giowin32.c glib/giounix.c glib/gmain.[ch]:
......
......@@ -27,4 +27,8 @@
are now safe against removal of the current item, not the next item.
It's not recommended to mutate the list in the callback to these
functions in any case.
\ No newline at end of file
functions in any case.
* GDate now works in UTF-8, not in the current locale. If you
want to use it with the encoding of the locale, you need
to convert strings using g_locale_to_utf8 first.
......@@ -120,6 +120,14 @@ the results may be needed.
See #G_PRIORITY_DEFAULT, #G_PRIORITY_DEFAULT_IDLE, #G_PRIORITY_HIGH,
#G_PRIORITY_HIGH_IDLE, and #G_PRIORITY_LOW.
<!-- ##### FUNCTION g_main_context_get ##### -->
<para>
</para>
@thread:
@Returns:
<!-- ##### FUNCTION g_main_loop_destroy ##### -->
<para>
......
......@@ -259,15 +259,6 @@ It is not used within GLib or GTK+.
</para>
<!-- ##### FUNCTION g_main_context_get ##### -->
<para>
</para>
@thread:
@Returns:
<!-- ##### FUNCTION g_main_context_default ##### -->
<para>
......@@ -644,7 +635,7 @@ the required condition has been met, and returns TRUE if so.
@prepare:
@check:
@dispatch:
@destroy:
@finalize:
<!-- ##### STRUCT GSourceCallbackFuncs ##### -->
<para>
......
......@@ -49,6 +49,7 @@ libglib_1_3_la_SOURCES = \
gunibreak.h \
gunibreak.c \
gunichartables.h \
gunicollate.c \
gunidecomp.h \
gunidecomp.c \
gutils.c
......
......@@ -512,16 +512,19 @@ g_date_fill_parse_tokens (const gchar *str, GDateParseTokens *pt)
if (pt->num_ints < 3)
{
gchar lcstr[128];
strncpy (lcstr, str, 127);
g_strdown (lcstr);
gchar *casefold;
gchar *normalized;
casefold = g_utf8_casefold (str);
normalized = g_utf8_normalize (casefold, G_NORMALIZE_ALL);
g_free (casefold);
i = 1;
while (i < 13)
{
if (long_month_names[i] != NULL)
{
const gchar *found = strstr (lcstr, long_month_names[i]);
const gchar *found = strstr (normalized, long_month_names[i]);
if (found != NULL)
{
......@@ -532,7 +535,7 @@ g_date_fill_parse_tokens (const gchar *str, GDateParseTokens *pt)
if (short_month_names[i] != NULL)
{
const gchar *found = strstr (lcstr, short_month_names[i]);
const gchar *found = strstr (normalized, short_month_names[i]);
if (found != NULL)
{
......@@ -575,21 +578,24 @@ g_date_prepare_to_parse (const gchar *str, GDateParseTokens *pt)
while (i < 13)
{
gchar *casefold;
g_date_set_dmy (&d, 1, i, 1);
g_return_if_fail (g_date_valid (&d));
g_date_strftime (buf, 127, "%b", &d);
casefold = g_utf8_casefold (buf);
g_free (short_month_names[i]);
g_strdown (buf);
short_month_names[i] = g_strdup (buf);
short_month_names[i] = g_utf8_normalize (casefold, G_NORMALIZE_ALL);
g_free (casefold);
g_date_strftime (buf, 127, "%B", &d);
casefold = g_utf8_casefold (buf);
g_free (long_month_names[i]);
g_strdown (buf);
long_month_names[i] = g_strdup (buf);
long_month_names[i] = g_utf8_normalize (casefold, G_NORMALIZE_ALL);
g_free (casefold);
++i;
}
......@@ -1331,7 +1337,7 @@ g_date_strftime (gchar *s,
const GDate *d)
{
struct tm tm;
gsize retval;
const gchar *charset;
g_return_val_if_fail (d != NULL, 0);
g_return_val_if_fail (g_date_valid (d), 0);
......@@ -1340,14 +1346,100 @@ g_date_strftime (gchar *s,
g_return_val_if_fail (s != 0, 0);
g_date_to_struct_tm (d, &tm);
retval = strftime (s, slen, format, &tm);
if (retval == 0)
if (g_get_charset (&charset))
{
/* If retval == 0, the contents of s are undefined. We define
* them.
*/
s[0] = '\0';
gint retval = strftime (s, slen, format, &tm);
if (retval == 0)
{
/* If retval == 0, the contents of s are undefined. We define
* them.
*/
s[0] = '\0';
}
return retval;
}
else
{
gchar *locale_format;
gsize tmplen;
gchar *tmpbuf;
gsize tmpbufsize;
gsize convlen = 0;
gchar *convbuf;
GError *error = NULL;
locale_format = g_convert (format, -1 , "UTF-8", charset,
NULL, NULL, &error);
if (error)
{
g_warning (G_STRLOC "Error converting format to %s: %s\n",
charset, error->message);
g_error_free (error);
return 0;
}
tmpbufsize = MAX (128, strlen (locale_format) * 2);
while (TRUE)
{
tmpbuf = g_malloc (tmpbufsize + 1);
tmplen = strftime (tmpbuf, tmpbufsize + 1, locale_format, &tm);
if (tmplen == tmpbufsize + 1)
{
g_free (tmpbuf);
tmpbufsize *= 2;
}
else
break;
}
g_free (locale_format);
if (tmplen == 0)
{
/* If retval == 0, the contents of s are undefined. We define
* them.
*/
g_free (locale_format);
s[0] = '\0';
return 0;
}
convbuf = g_convert (tmpbuf, tmplen, "UTF-8", charset, NULL, &convlen, &error);
g_free (tmpbuf);
if (error)
{
g_warning (G_STRLOC "Error converting results of strftime to UTF-8: %s\n", error->message);
g_error_free (error);
}
else
{
/* Only copy whole characters into the buffer
*/
gchar *in = convbuf;
gchar *out = s;
gchar *end = s + slen - 1;
while (*in)
{
int len = g_utf8_skip[*(guchar *)in];
if (out + len < end)
{
out += len;
in += len;
}
else
break;
}
memcpy (s, convbuf, out - s);
*out = '\0';
}
g_free (convbuf);
return convlen;
}
return retval;
}
#! /usr/bin/perl -w
# Copyright (C) 1998, 1999 Tom Tromey
# Copyright (C) 2001 Red Hat Software
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -19,7 +20,7 @@
# gen-unicode-tables.pl - Generate tables for libunicode from Unicode data.
# See http://www.unicode.org/Public/UNIDATA/UnicodeCharacterDatabase.html
# Usage: gen-unicode-tables.pl [-decomp | -both] UNICODE-VERSION UnicodeData.txt LineBreak.txt
# Usage: gen-unicode-tables.pl [-decomp | -both] UNICODE-VERSION UnicodeData.txt LineBreak.txt SpecialCasing.txt CaseFolding.txt
# I consider the output of this program to be unrestricted. Use it as
# you will.
......@@ -29,7 +30,7 @@
# * For decomp table it might make sense to use a shift count other
# than 8. We could easily compute the perfect shift count.
use vars qw($CODE $NAME $CATEGORY $COMBINING_CLASSES $BIDI_CATEGORY $DECOMPOSITION $DECIMAL_VALUE $DIGIT_VALUE $NUMERIC_VALUE $MIRRORED $OLD_NAME $COMMENT $UPPER $LOWER $TITLE $BREAK_CODE $BREAK_CATEGORY $BREAK_NAME);
use vars qw($CODE $NAME $CATEGORY $COMBINING_CLASSES $BIDI_CATEGORY $DECOMPOSITION $DECIMAL_VALUE $DIGIT_VALUE $NUMERIC_VALUE $MIRRORED $OLD_NAME $COMMENT $UPPER $LOWER $TITLE $BREAK_CODE $BREAK_CATEGORY $BREAK_NAME $CASE_CODE $CASE_LOWER $CASE_TITLE $CASE_UPPER $CASE_CONDITION);
# Names of fields in Unicode data table.
$CODE = 0;
......@@ -51,7 +52,18 @@ $TITLE = 14;
# Names of fields in the line break table
$BREAK_CODE = 0;
$BREAK_PROPERTY = 1;
$BREAK_NAME = 2;
# Names of fields in the SpecialCasing table
$CASE_CODE = 0;
$CASE_LOWER = 1;
$CASE_TITLE = 2;
$CASE_UPPER = 3;
$CASE_CONDITION = 4;
# Names of fields in the CaseFolding table
$FOLDING_CODE = 0;
$FOLDING_STATUS = 1;
$FOLDING_MAPPING = 2;
# Map general category code onto symbolic name.
%mappings =
......@@ -128,23 +140,54 @@ $BREAK_NAME = 2;
%title_to_lower = ();
%title_to_upper = ();
# Maximum length of special-case strings
my $special_case_len = 0;
my @special_cases;
$do_decomp = 0;
$do_props = 1;
if ($ARGV[0] eq '-decomp')
if (@ARGV && $ARGV[0] eq '-decomp')
{
$do_decomp = 1;
$do_props = 0;
shift @ARGV;
}
elsif ($ARGV[0] eq '-both')
elsif (@ARGV && $ARGV[0] eq '-both')
{
$do_decomp = 1;
shift @ARGV;
}
if (@ARGV != 6) {
$0 =~ s@.*/@@;
die "Usage: $0 [-decomp | -both] UNICODE-VERSION UnicodeData.txt LineBreak.txt SpecialCasing.txt CaseFolding.txt CompositionExclusions.txt\n";
}
print "Creating decomp table\n" if ($do_decomp);
print "Creating property table\n" if ($do_props);
print "Composition exlusions from $ARGV[5]\n";
open (INPUT, "< $ARGV[5]") || exit 1;
while (<INPUT>) {
chop;
next if /^#/;
next if /^\s*$/;
s/\s*#.*//;
s/^\s*//;
s/\s*$//;
$composition_exclusions{hex($_)} = 1;
}
close INPUT;
print "Unicode data from $ARGV[1]\n";
open (INPUT, "< $ARGV[1]") || exit 1;
......@@ -189,6 +232,8 @@ while (<INPUT>)
$last_code = $code;
}
close INPUT;
@gfields = ('', '', 'Cn', '0', '', '', '', '', '', '', '',
'', '', '', '');
for (++$last_code; $last_code < 0x10000; ++$last_code)
......@@ -207,54 +252,59 @@ open (INPUT, "< $ARGV[2]") || exit 1;
$last_code = -1;
while (<INPUT>)
{
my ($start_code, $end_code);
chop;
next if /^#/;
s/\s*#.*//;
@fields = split (';', $_, 30);
if ($#fields != 2)
if ($#fields != 1)
{
printf STDERR ("Entry for $fields[$CODE] has wrong number of fields (%d)\n", $#fields);
next;
}
$code = hex ($fields[$CODE]);