summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDom Lachowicz <domlachowicz@gmail.com>2003-10-15 00:38:30 +0000
committerDom Lachowicz <domlachowicz@gmail.com>2003-10-15 00:38:30 +0000
commit0c78609090e31d93508dcfe4faea520ee137e572 (patch)
tree749ee6863d2f0afaf502d1b7dcf322a098f26844
parentfa1824a374f4d7e6860fbcec830120bc77601002 (diff)
downloadenchant-0c78609090e31d93508dcfe4faea520ee137e572.tar.gz
some utf8 fixes for silly glibs - from raphael
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@20877 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r--tests/enchant-ispell.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/enchant-ispell.c b/tests/enchant-ispell.c
index a80bc6a..33a3598 100644
--- a/tests/enchant-ispell.c
+++ b/tests/enchant-ispell.c
@@ -91,12 +91,13 @@ consume_line (FILE * in, GString * str)
if (str->len) {
utf = g_locale_to_utf8 (str->str, str->len, &bytes_read, &bytes_written, NULL);
- g_string_truncate (str, 0);
if (utf) {
g_string_assign (str, utf);
g_free (utf);
- }
+ }
+ /* else str->str stays the same. we'll assume that it's
+ already utf8 and glib is just being stupid */
}
return ret;
@@ -112,6 +113,8 @@ print_utf (FILE * out, const char * str)
if (native) {
fwrite (native, 1, bytes_written, out);
g_free (native);
+ } else {
+ fwrite (str, 1, strlen (str), out);
}
}