From: Max Kellermann Date: Tue, 23 Sep 2008 11:41:49 +0000 (+0200) Subject: lyrics: print text in UTF-8 X-Git-Tag: v0.12_alpha1~171 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3052dceb948336a0671f7bea24f8b378cae4ce30;p=ncmpc.git lyrics: print text in UTF-8 Python defaults to sending ASCII characters, and aborts if there are non-ASCII characters in the string. Unfortunately, due to "C.UTF-8" being not defined, we cannot reliably make Python use UTF-8, without further locale settings. Thus, work around this mess by manually encoding the result to UTF-8 in the script. --- diff --git a/lyrics/leoslyrics.py b/lyrics/leoslyrics.py index 0cee65a..1e89759 100755 --- a/lyrics/leoslyrics.py +++ b/lyrics/leoslyrics.py @@ -65,4 +65,4 @@ def lyrics(hid): hid = search(argv[1], argv[2]) if hid is None: exit(2) -print lyrics(hid) +print lyrics(hid).encode('utf-8')