From 4be0945c17657caf412048c757ff355cd72c0d45 Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 26 Dec 2008 06:00:52 +0000 Subject: [PATCH] (main): Print a proper error message if the specified encoding requires m17n-db. --- example/mconv.c | 6 ++++++ 1 file changed, 6 insertions(+) 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. */ -- 1.7.10.4