From: Peng Huang Date: Sat, 10 Apr 2010 00:00:36 +0000 (+0800) Subject: Refine code. X-Git-Tag: 1.3.10~247 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de1000ba701981b4d803dad7865ab8e31ec13d13;p=platform%2Fupstream%2Fibus-libpinyin.git Refine code. --- diff --git a/src/SimpTradConverter.cc b/src/SimpTradConverter.cc index 6d34492..1fb6fb9 100644 --- a/src/SimpTradConverter.cc +++ b/src/SimpTradConverter.cc @@ -18,15 +18,15 @@ static int _cmp (const void *p1, const void *p2) void SimpTradConverter::simpToTrad (const gchar *in, String &out) { - if (!g_utf8_validate (in, -1 , NULL)) { - g_debug ("\%s\" is not an utf8 string!", in); - g_assert_not_reached (); - } - gunichar *p; gunichar *in_ucs4; gunichar buf[SIMP_TO_TRAD_MAX_LEN + 1]; + if (!g_utf8_validate (in, -1 , NULL)) { + g_warning ("\%s\" is not an utf8 string!", in); + g_assert_not_reached (); + } + p = in_ucs4 = g_utf8_to_ucs4_fast (in, -1, NULL); while (*p != 0) { @@ -34,6 +34,7 @@ SimpTradConverter::simpToTrad (const gchar *in, String &out) const gunichar **result; for (i = 0; i < SIMP_TO_TRAD_MAX_LEN && p[i] != 0; i++) { buf[i] = p[i]; + g_debug ("i = %d", i); } for (; i > 0; i--) { buf[i] = 0;