From b906c345f9c03db2c3786e6570d3728c12a00be9 Mon Sep 17 00:00:00 2001 From: Lauris Kaplinski Date: Wed, 23 Aug 2000 02:56:59 +0000 Subject: UTF-8 in contact editor + some fixes for dealing with illegal strings svn path=/trunk/; revision=4976 --- e-util/ChangeLog | 8 ++++++++ e-util/e-font.c | 6 ++++++ 2 files changed, 14 insertions(+) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 42ffd785d4..837a080fb3 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,11 @@ +2000-08-22 Lauris Kaplinski + + * e-unicode.h: + * e-unicode.c: e_utf8_gtk_editable_get_chars + e_utf8_gtk_entry_get_text + e_utf8_gtk_entry_set_text + e_utf8_to_gtk_string: New convenience functions + 2000-08-22 Lauris Kaplinski * e-unicode.h: diff --git a/e-util/e-font.c b/e-util/e-font.c index a13f0b962c..35b9d4db72 100644 --- a/e-util/e-font.c +++ b/e-util/e-font.c @@ -95,6 +95,9 @@ e_font_utf8_text_width (EFont *font, EFontStyle style, char *text, int numbytes) gchar *p; gint uni, len; + g_return_val_if_fail (font != NULL, 0); + g_return_val_if_fail (text != NULL, 0); + iso = alloca (numbytes); for (len = 0, p = text; p != NULL && p < (text + numbytes); len++, p = unicode_next_utf8 (p)) { @@ -112,6 +115,9 @@ e_font_utf8_char_width (EFont *font, EFontStyle style, char *text) unicode_char_t uni; guchar iso; + g_return_val_if_fail (font != NULL, 0); + g_return_val_if_fail (text != NULL, 0); + if (!unicode_get_utf8 (text, &uni)) return 0; if ((uni < ' ') || (uni > 255)) uni = ' '; -- cgit v1.2.3