From: handa Date: Fri, 26 Dec 2008 06:00:52 +0000 (+0000) Subject: (main): Print a proper error message if the specified X-Git-Tag: REL-1-5-4~22 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=4be0945c17657caf412048c757ff355cd72c0d45;p=m17n%2Fm17n-lib.git (main): Print a proper error message if the specified encoding requires m17n-db. --- diff --git a/example/mconv.c b/example/mconv.c index f31e5a6..f33a4f3 100644 --- a/example/mconv.c +++ b/example/mconv.c @@ -366,6 +366,9 @@ main (int argc, char **argv) /* Create a converter for decoding. */ converter = mconv_stream_converter (incode, in); + if (! converter) + FATAL_ERROR ("Encoding \"%s\" requires the missing library \"m17n-db\".\n", + msymbol_name (incode)); /* Instead of doing strict decoding, we decode all input bytes at once, and check invalid bytes later by the fuction check_invalid_bytes. */ @@ -383,6 +386,9 @@ main (int argc, char **argv) /* Create a converter for encoding. */ converter = mconv_stream_converter (outcode, out); + if (! converter) + FATAL_ERROR ("Encoding \"%s\" requires the missing library \"m17n-db\".\n", + msymbol_name (outcode)); /* Instead of doing strict encoding, we encode all characters at once, and check unencoded characters later by the fuction check_unencoded_chars. */