diff options
author | Kalle Wallin <kaw@linux.se> | 2004-04-14 19:26:25 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-04-14 19:26:25 +0000 |
commit | 3b9684fc2a84b50ec682db84c1c82f6760250806 (patch) | |
tree | 7cba573b1fc7d1f9485a4da1982420e4636b45b2 /support.c | |
parent | 6dfaea01e920b3a9ffe0eca8545accf976413f3f (diff) | |
download | mpd-3b9684fc2a84b50ec682db84c1c82f6760250806.tar.gz mpd-3b9684fc2a84b50ec682db84c1c82f6760250806.tar.xz mpd-3b9684fc2a84b50ec682db84c1c82f6760250806.zip |
Use screen_status_printf() to display character conversion errors. Only use
stderr if DEBUG is enabled.
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@758 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | support.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -11,8 +11,16 @@ #include <locale.h> #endif +#ifdef DEBUG +#define D(x) x +#else +#define D(x) +#endif + #define BUFSIZE 1024 +extern void screen_status_printf(char *format, ...); + static const char *charset = NULL; static const char *locale = NULL; static gboolean noconvert = TRUE; @@ -148,7 +156,9 @@ utf8_to_locale(char *utf8str) &error); if( error ) { - g_printerr("utf8_to_locale(): %s\n", error->message); + screen_status_printf("Error: Unable to convert characters to %s", + charset); + D(g_printerr("utf8_to_locale(): %s\n", error->message)); g_error_free(error); return g_strdup(utf8str); } @@ -175,7 +185,8 @@ locale_to_utf8(char *localestr) &error); if( error ) { - g_printerr("locale_to_utf8: %s\n", error->message); + screen_status_printf("Error: Unable to convert characters to UTF-8"); + D(g_printerr("locale_to_utf8: %s\n", error->message)); g_error_free(error); return g_strdup(localestr); } |