summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b68c58)
raw | patch | inline | side by side (parent: 3b68c58)
author | Max Kellermann <max@duempel.org> | |
Tue, 23 Sep 2008 11:41:49 +0000 (13:41 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 23 Sep 2008 11:41:49 +0000 (13:41 +0200) |
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.
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 | patch | blob | history |
diff --git a/lyrics/leoslyrics.py b/lyrics/leoslyrics.py
index 0cee65aee4edcea651996c4960e7238b78f56867..1e8975910619bb7e2c5dec978f3d240247f44ad4 100755 (executable)
--- a/lyrics/leoslyrics.py
+++ b/lyrics/leoslyrics.py
hid = search(argv[1], argv[2])
if hid is None:
exit(2)
-print lyrics(hid)
+print lyrics(hid).encode('utf-8')