summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDom Lachowicz <domlachowicz@gmail.com>2003-09-25 02:40:44 +0000
committerDom Lachowicz <domlachowicz@gmail.com>2003-09-25 02:40:44 +0000
commitb383dc36d48c1f0bf9d198d147b365193b0df10b (patch)
tree4d36bd0c478be8159a42177954d82760444e5363 /tests
parentb2e06c67c998b05a61b7af7a6355967f3eb8daee (diff)
downloadenchant-b383dc36d48c1f0bf9d198d147b365193b0df10b.tar.gz
re-implement utf8 stuff that raphael took out
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@20860 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
Diffstat (limited to 'tests')
-rw-r--r--tests/enchant-ispell.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/enchant-ispell.c b/tests/enchant-ispell.c
index 4af85dd..b9f0000 100644
--- a/tests/enchant-ispell.c
+++ b/tests/enchant-ispell.c
@@ -92,6 +92,14 @@ 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);
+ }
+
return ret;
}
@@ -101,12 +109,11 @@ print_utf (FILE * out, const char * str)
gsize bytes_read, bytes_written;
gchar * native;
- // fprintf(out, "[%s]", str);
- fprintf(out, "%s", str);
- return;
native = g_locale_from_utf8 (str, -1, &bytes_read, &bytes_written, NULL);
- fwrite (native, 1, bytes_written, out);
- g_free (native);
+ if (native) {
+ fwrite (native, 1, bytes_written, out);
+ g_free (native);
+ }
}
static void