From: handa Date: Mon, 21 Jun 2004 00:16:10 +0000 (+0000) Subject: (mconv_decode, mconv_gets): Adjust the format of MT to X-Git-Tag: withdl~65 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a384dc0c6c79e2f62fa81bda32d8271ff7e4f114;p=m17n%2Fm17n-lib.git (mconv_decode, mconv_gets): Adjust the format of MT to utf-8. --- diff --git a/src/coding.c b/src/coding.c index 533970e..47db291 100644 --- a/src/coding.c +++ b/src/coding.c @@ -4404,6 +4404,9 @@ mconv_decode (MConverter *converter, MText *mt) M_CHECK_READONLY (mt, NULL); + if (mt->format != MTEXT_FORMAT_UTF_8) + mtext__adjust_format (mt, MTEXT_FORMAT_UTF_8); + if (! mt->data) mtext__enlarge (mt, MAX_UTF8_CHAR_BYTES); @@ -5037,6 +5040,9 @@ mconv_gets (MConverter *converter, MText *mt) int c; M_CHECK_READONLY (mt, NULL); + if (mt->format != MTEXT_FORMAT_UTF_8) + mtext__adjust_format (mt, MTEXT_FORMAT_UTF_8); + while (1) { c = mconv_getc (converter);