diff options
author | Max Kellermann <max@duempel.org> | 2008-11-07 16:14:39 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-07 16:14:39 +0100 |
commit | c238364f6833320fee4256226af650347d5a751b (patch) | |
tree | c04fbb8f91e34dea95410290b941bee627e66c18 /src/main.c | |
parent | 06aafa1328f50d247676c2eca488e53fa02c0dbd (diff) | |
download | mpd-c238364f6833320fee4256226af650347d5a751b.tar.gz mpd-c238364f6833320fee4256226af650347d5a751b.tar.xz mpd-c238364f6833320fee4256226af650347d5a751b.zip |
mpdclient: expect UTF-8 strings
Don't convert the character set of strings to and from the current
locale. This library cannot know what the strings are going to be
used for, so it should not mess with them.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index 1e65cfeb8..b9fb3cd0e 100644 --- a/src/main.c +++ b/src/main.c @@ -74,8 +74,10 @@ error_msg(const gchar *msg) } static void -error_callback(mpd_unused mpdclient_t *c, gint error, const gchar *msg) +error_callback(mpd_unused mpdclient_t *c, gint error, const gchar *_msg) { + char *msg = utf8_to_locale(_msg); + error = error & 0xFF; switch (error) { case MPD_ERROR_CONNPORT: @@ -91,6 +93,8 @@ error_callback(mpd_unused mpdclient_t *c, gint error, const gchar *msg) doupdate(); connected = FALSE; } + + g_free(msg); } #ifndef NCMPC_MINI |