From 3052dceb948336a0671f7bea24f8b378cae4ce30 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Sep 2008 13:41:49 +0200 Subject: [PATCH] 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. --- lyrics/leoslyrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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') -- 2.30.2