Commit Graph

45 Commits

Author SHA1 Message Date
Philip Withnall
386bb0faad unicode: Fix a few issues with G_UNICHAR_MAX_DECOMPOSITION_LENGTH
Raised by Matthias in bgo#665685 but which I didn't spot until after pushing
commit 3ac7c35656.

Renames G_UNICHAR_MAX_DECOMPOSITION_LEN to G_UNICHAR_MAX_DECOMPOSITION_LENGTH
and fixes a few documentation issues.

See: bgo#665685
2011-12-06 19:41:31 +00:00
Philip Withnall
3ac7c35656 Bug 665685 — Add a #define for the max length of a Unicode decomposition
Add G_UNICHAR_MAX_DECOMPOSITION_LEN for the maximum length of the
decomposition of a single Unicode character.

Closes: bgo#665685
2011-12-06 19:09:01 +00:00
Behdad Esfahbod
10a154446c Minor doc fix. 2011-12-06 13:20:39 -05:00
Behdad Esfahbod
b7051e8da8 Fix docs 2011-09-15 16:51:51 -04:00
Behdad Esfahbod
e3219c8425 Fixup max decomposition len guarantee
Unicode Technical Committee agreed to limit decomposition length to
18 in both cases.  Reflect that.
2011-08-17 12:14:07 +02:00
Matthias Clasen
09e2d2a61c Move Unicode docs inline, ditch template 2011-07-18 23:23:17 -04:00
Behdad Esfahbod
615977d337 Simplify Hangul Jamo decomposition
The algorithm is not copy/paste from Unicode anymore, but it's easy
enough to follow the logic.
2011-07-18 18:12:35 -04:00
Behdad Esfahbod
0584fe33de Bug 654651 - Better g_unicode_canonical_decomposition()
Add g_unichar_fully_decompose().
Deprecate g_unicode_canonical_decomposition().
2011-07-18 18:12:35 -04:00
Behdad Esfahbod
7041b701dd Remove comp_step_table table
Reuse the pre-existing composition data.
2011-07-14 16:55:35 -04:00
Behdad Esfahbod
89a5d17d58 Document, that the second part of a decompose() wouldn't decompose()
This is not directly documented in Unicode, or I couldn't find it,
but the test I just added confirms that it is currently the case.
2011-07-14 16:55:35 -04:00
Behdad Esfahbod
cff4b5b3a3 Remove stale comment
Unicode guarantees that.
2011-07-14 16:55:35 -04:00
Behdad Esfahbod
a73c66b134 Add tests for Unicode canonical composition/decomposition
Also update compose()/decompose() API corner cases and docs.
2011-07-14 16:55:35 -04:00
Matthias Clasen
761a1841ee Bug 654195 - Add g_unichar_compose() and g_unichar_decompose() 2011-07-14 16:55:34 -04:00
Matthias Clasen
f13d561211 More header inclusion cleanup 2010-09-05 00:23:03 -04:00
Ryan Lortie
2e53e50244 glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
Matthias Clasen
065928c778 Fix a doc issue
svn path=/trunk/; revision=7310
2008-08-05 01:23:16 +00:00
Mathias Hasselmann
c79ef3793c Mention g_utf8_normalize() returns NULL on invalid string. (#501997)
* glib/gunidecomp.c: Mention g_utf8_normalize()
returns NULL on invalid string. (#501997)

svn path=/trunk/; revision=6058
2007-12-06 10:22:13 +00:00
Matthias Clasen
bda8d80b6d Documentation cleanups
svn path=/trunk/; revision=5652
2007-07-22 04:14:54 +00:00
Behdad Esfahbod
613b489b6b Make g_unichar_combining_class() public. (#453998)
2007-07-19  Behdad Esfahbod  <behdad@gnome.org>

        * glib/glib.symbols:
        * glib/gunicode.h:
        * glib/gunicodeprivate.h:
        * glib/gunidecomp.c (g_unichar_combining_class):
        * glib/guniprop.c (has_more_above):
        Make g_unichar_combining_class() public. (#453998)


svn path=/trunk/; revision=5644
2007-07-19 13:46:05 +00:00
Behdad Esfahbod
290443f86f Update to reflect Unicode PR #29 (#348694, Nikolai Weibull)
2006-07-31  Behdad Esfahbod  <behdad@gnome.org>

        * glib/gunidecomp.c (_g_utf8_normalize_wc): Update to reflect Unicode
        PR #29 (#348694, Nikolai Weibull)

        * tests/unicode-normalize.c (encode), (test_form): Make output more
        useful, reporting the unexpected output of the test.
2006-07-31 04:50:05 +00:00
Matthias Clasen
499d7937b7 Don't eat Hangul when normalizing. (#301742, reported by Christian Biere,
2005-05-25  Matthias Clasen  <mclasen@redhat.com>

	* glib/gunidecomp.c (combine_hangul): Don't eat Hangul
	when normalizing.  (#301742, reported by Christian Biere,
	patch by Noah Levitt)
2005-05-25 16:03:13 +00:00
Matthias Clasen
c8099fa3e9 Correct the end of the Hangul Syllables range, from 0xd7af to 0xd7a3, in
2005-05-18  Matthias Clasen  <mclasen@redhat.com>

	* glib/gunidecomp.c: Correct the end of the Hangul
	Syllables range, from 0xd7af to 0xd7a3, in several
	places.  (#301984, Changwoo Ryu)
2005-05-18 13:41:11 +00:00
Matthias Clasen
608a31b98e Make PLT-reduction work with gcc4, and don't include everything in
2005-03-13  Matthias Clasen  <mclasen@redhat.com>

	Make PLT-reduction work with gcc4, and don't include
	everything in galias.h:

	* glib/glib.symbols: Group symbols by header and source file.
	* glib/makegalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegalias.pl -def
	* glib/Makefile.am (galiasdef.c): Add a rule to generate this
	file.
	* glib/*.c: Include galias.h after the other GLib headers,
	include galiasdef.c at the bottom.
2005-03-14 04:26:57 +00:00
Matthias Clasen
dafdffd751 Implement the same PLT reduction technique used in GTK+:
Thu Sep 16 02:03:15 2004  Matthias Clasen  <maclas@gmx.de>

	Implement the same PLT reduction technique used in GTK+:
2004-09-16 06:05:53 +00:00
Noah Levitt
782188d539 Size compose_table correctly. (#123421, Simon Josefsson)
2004-01-30  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunicomp.h:
	* glib/gunidecomp.c:
	* glib/gen-unicode-tables.pl: Size compose_table correctly. (#123421,
        Simon Josefsson)

	* glib/gen-unicode-tables.pl: Get rid of some new warnings from perl
	5.8.1.
2004-01-30 23:20:16 +00:00
Manish Singh
267031000f fix gint/gsize confusion.
Fri Dec  5 12:09:13 2003  Manish Singh  <yosh@gimp.org>

        * glib/gunidecomp.c (_g_utf8_normalize_wc): fix gint/gsize confusion.
2003-12-05 20:09:34 +00:00
Noah Levitt
45b1590923 Add hangul composition and decomposition to unicode normalization.
2003-12-04  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunidecomp.c: Add hangul composition and decomposition to
	unicode normalization. (#100456)

	* tests/unicode-normalize.c: Test hangul.
2003-12-04 19:47:52 +00:00
Noah Levitt
8d91ba8c58 Unicode 4.0 special casing. (#114681)
2003-09-10  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunicodeprivate.h:
	* glib/gunicollate.c:
	* glib/gunidecomp.c:
	* glib/guniprop.c:
	* tests/casemap.txt:
	* tests/gen-casemap-txt.pl: Unicode 4.0 special casing. (#114681)

	* glib/gunicodeprivate.h: Use a private header instead of extern
	function declarations (_g_utf8_normalize_wc,
	_g_unichar_combining_class).
2003-09-10 16:55:36 +00:00
Noah Levitt
05f99527eb Update Unicode data to 4.0. (#107974)
2003-07-30  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gen-unicode-tables.pl:
	* glib/gunibreak.c:
	* glib/gunibreak.h:
	* glib/gunichartables.h:
	* glib/gunicode.h:
	* glib/gunicomp.h:
	* glib/gunidecomp.c:
	* glib/gunidecomp.h:
	* glib/guniprop.c:
	* tests/casefold.txt:
	* tests/casemap.txt:
	* tests/gen-casefold-txt.pl:
	* tests/gen-casemap-txt.pl: Update Unicode data to 4.0. (#107974)
2003-07-31 02:27:56 +00:00
Noah Levitt
fef203f9f7 Fix typo (#114375). Also, make the function static.
2003-06-04  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunidecomp.h (combine): Fix typo (#114375). Also, make the
	function static.
2003-06-04 20:53:55 +00:00
Noah Levitt
6bc2ee510a Fix off-by-one error in g_unicode_canonical_ordering (bug #113260).
2003-05-19  Noah Levitt  <nlevitt@columbia.edu>

	* glib/gunidecomp.c: Fix off-by-one error in
	g_unicode_canonical_ordering (bug #113260).
2003-05-19 15:54:48 +00:00
Matthias Clasen
98fefa5b5f Use g_malloc instead of directly using malloc.
2003-02-26  Matthias Clasen  <maclas@gmx.de>

	* glib/gunidecomp.c (g_unicode_canonical_decomposition): Use
	g_malloc instead of directly using malloc.
2003-02-25 23:20:16 +00:00
Owen Taylor
bbbd329ff5 Patch from Sven Neumann to make the include order consistent. (#71704)
Tue Dec  3 20:22:27 2002  Owen Taylor  <otaylor@redhat.com>

        * glib/*.c: Patch from Sven Neumann to make the
        include order consistent. (#71704)
2002-12-04 01:27:44 +00:00
Owen Taylor
57d9c0926a 1.3.14
Sun Feb 17 11:37:06 2002  Owen Taylor  <otaylor@redhat.com>

        * 1.3.14

        * glib/glibintl.h: Error out of config.h wasn't included
        rather than including it, since config.h must be the
        first thing included.

        * glib/gconvert.c glib/gmarkup.c glib/gshell.c glib/gspawn.c
        glib/gunibreak.c glib/gunidecomp.c glib/guniprop.c:
        Include config.h as the first thing. (#71704, Morten
        Welinder)
2002-02-17 23:28:43 +00:00
Owen Taylor
2bbd00a263 Patch from Andrew Taylor to optimize the decomposition table to eliminate
Tue Nov 20 20:54:25 2001  Owen Taylor  <otaylor@redhat.com>
	* glib/gunidecomp.[ch] glib/gen-unicode-tables.pl: Patch
	from Andrew Taylor to optimize the decomposition table
	to eliminate relocations and save space. (#64982)
2001-11-21 01:57:10 +00:00
Owen Taylor
917026269e Patch from Andrew Taylor to improve tables and reduce relocations by using
Tue Nov 13 21:25:35 2001  Owen Taylor  <otaylor@redhat.com>

	* glib/{gen-unicode-tables.pl,gunibreak.c,gunibreak.h,
	gunichartables.h, gunicomp.h, gunidecomp.[ch],
	guniprop.c}: Patch from Andrew Taylor to improve
	tables and reduce relocations by using indices
	rather than pointers. (#64433)

	* tests/unicode-normalize.c (main): Fix for changes
	to g_strsplit().
2001-11-14 02:32:45 +00:00
Matthias Clasen
50d0ad9803 glib/gutf8.c, glib/gunibreak.c, glib/gunicollate.c,
glib/gunidecomp.c, glib/guniprop.c: Inline doc consistency fixes.
2001-09-24 21:28:57 +00:00
Owen Taylor
b24544c0bc Fix some variables that should have been static.
Sun Sep  2 11:10:42 2001  Owen Taylor  <otaylor@redhat.com>

        * glib/gen-unicode-tables.pl glib/gunicomp.h
        glib/gunichartables.h glib/giounix.c: Fix some variables that
        should have been static.
2001-09-02 15:44:21 +00:00
Owen Taylor
6d7ee81303 s/size_t/gsize/ to match prototypes.
Fri Jul 20 14:11:29 2001  Owen Taylor  <otaylor@redhat.com>

	* glib/gutf8.c glib/gunidecomp.c: s/size_t/gsize/ to match
	prototypes.
2001-07-20 18:12:10 +00:00
Owen Taylor
f1f680b68c Add length arguments to g_utf8_{strup,strdown,casefold,collate_key}.
Fri Jul  6 22:34:32 2001  Owen Taylor  <otaylor@redhat.com>

	* glib/gunicode.h glib/gunidecomp.c glib/guniprop.c
	  glib/gunicollate.c: Add length arguments to
	g_utf8_{strup,strdown,casefold,collate_key}.

	* glib/gdate.c: Fix for above.
2001-07-07 02:42:49 +00:00
Owen Taylor
4f96a13cba 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.
2001-07-02 00:49:21 +00:00
Havoc Pennington
7fce6d3abc s/UNICODE_LAST_CHAR/G_UNICODE_LAST_CHAR/
2000-11-29  Havoc Pennington  <hp@redhat.com>

	* gunidecomp.c (COMBINING_CLASS): s/UNICODE_LAST_CHAR/G_UNICODE_LAST_CHAR/

	* gunichartables.h: Update for data in Unicode 3.0.1,
	and include tables for line break properties

	* gunidecomp.h: Ditto

	* gunicode.h (GUnicodeBreakType): Enum for line break properties
	(g_unichar_break_type): Get the break property for a char

	* gunibreak.h: Autogenerated line break property tables

	* gunibreak.c (g_unichar_break_type): added

	* Makefile.am (EXTRA_DIST): dist gen-unicode-tables.pl

	* Makefile.am (libglib_1_3_la_SOURCES): Add gunibreak.h, gunibreak.c

	* gen-unicode-tables.pl: Include the script to update the unicode
	char tables
2000-11-29 23:38:24 +00:00
Elliot Lee
790a7bd3be Fix warnings.
* gmarkup.c: Fix warnings.

* guniprop.c, gunidecomp.c: Make warnings go away by using
GPOINTER_TO_INT() instead of (int).

* gcompletion.[ch]: Add g_completion_set_compare(),
to allow (for example) using case-insensitive completion.

* gobject/gsignal.c: Fix warnings about possible use of uninitialized
variables, and fix logic that would leave 'node' unset in cases
that it might be used in.

* gobject/glib-genmarshal.c: Fix warning about printf format.
2000-11-28 23:44:21 +00:00
Tim Janik
c9bd7542e1 applied patch from Andreas Persenius <ndap@swipnet.se> that updates the
Wed Jul 26 12:59:31 2000  Tim Janik  <timj@gtk.org>

        * *.[hc]: applied patch from Andreas Persenius <ndap@swipnet.se> that
        updates the license headers to the GNU Lesser General Public License,
        as well as updating the copyright year to 2000.
2000-07-26 11:02:02 +00:00
Owen Taylor
0891c64816 Initial pass at adding unicode support functions. A few things still need
Wed Jun 21 12:09:03 2000  Owen Taylor  <otaylor@redhat.com>

	* gunicode.h gutf8.c guniprop.c gunidecomp.[ch] gunichartables.h
	Makefile.am glib.h: Initial pass at adding unicode support
	functions. A few things still need to be implemented, a bit
	of cleanup needs to be done, tests need to be added, and
	the docs need to be finished, but this should allow replacing
	most or all use of libunicode.
2000-06-21 16:11:21 +00:00