[dvblast-devel] Display better error mesage when iconv_open() fails.

Stas Sergeev git at videolan.org
Tue Oct 29 10:23:32 CET 2013


dvblast | branch: master | Stas Sergeev <stsp at users.sourceforge.net> | Tue Oct 22 17:29:40 2013 +0400| [5bfa4c333f6aa05cee14a7503e47499d2dfd4076] | committer: Georgi Chorbadzhiyski

Display better error mesage when iconv_open() fails.

It is better to have different error messages for iconv_open() and iconv()
to see more precisely which one fails (and iconv_open() actually fails)

> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=5bfa4c333f6aa05cee14a7503e47499d2dfd4076
---

 demux.c      |    2 +-
 dvblastctl.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/demux.c b/demux.c
index 4b59712..5d7893b 100644
--- a/demux.c
+++ b/demux.c
@@ -1852,7 +1852,7 @@ char *demux_Iconv(void *_unused, const char *psz_encoding,
     if (iconv_handle == (iconv_t)-1)
         iconv_handle = iconv_open(psz_native_charset, psz_encoding);
     if (iconv_handle == (iconv_t)-1) {
-        msg_Warn(NULL, "couldn't convert from %s to %s (%m)", psz_encoding,
+        msg_Warn(NULL, "couldn't open converter from %s to %s (%m)", psz_encoding,
                 psz_native_charset);
         return iconv_append_null(p_string, i_length);
     }
diff --git a/dvblastctl.c b/dvblastctl.c
index 438bac0..92d0304 100644
--- a/dvblastctl.c
+++ b/dvblastctl.c
@@ -138,7 +138,7 @@ char *psi_iconv(void *_unused, const char *psz_encoding,
     if (iconv_handle == (iconv_t)-1)
         iconv_handle = iconv_open(psz_native_charset, psz_encoding);
     if (iconv_handle == (iconv_t)-1) {
-        msg_Warn(NULL, "couldn't convert from %s to %s (%m)", psz_encoding,
+        msg_Warn(NULL, "couldn't open converter from %s to %s (%m)", psz_encoding,
                 psz_native_charset);
         return iconv_append_null(p_string, i_length);
     }



More information about the dvblast-devel mailing list