From a384dc0c6c79e2f62fa81bda32d8271ff7e4f114 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 21 Jun 2004 00:16:10 +0000 Subject: [PATCH] (mconv_decode, mconv_gets): Adjust the format of MT to utf-8. --- src/coding.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 1.7.10.4