summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 299b9c1)
raw | patch | inline | side by side (parent: 299b9c1)
author | Max Kellermann <max@duempel.org> | |
Thu, 2 Oct 2008 17:01:30 +0000 (19:01 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 2 Oct 2008 17:01:30 +0000 (19:01 +0200) |
Convert the lyrics to the current character set before displaying
them.
them.
src/screen_lyrics.c | patch | blob | history |
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index 927b3dd9c486e0009af6d17ac5f7adeed49c9fd1..b1812de31154764efee7db1925bef9296f7d4f2f 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
#include "screen_utils.h"
#include "strfsong.h"
#include "lyrics.h"
+#include "charset.h"
#include "gcc.h"
#define _GNU_SOURCE
static const char *
list_callback(unsigned idx, mpd_unused int *highlight, mpd_unused void *data)
{
+ static char buffer[256];
+ char *value;
+
if (idx >= current.lines->len)
return NULL;
- return g_ptr_array_index(current.lines, idx);
+ value = utf8_to_locale(g_ptr_array_index(current.lines, idx));
+ g_strlcpy(buffer, value, sizeof(buffer));
+ free(value);
+
+ return buffer;
}