summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwikiquery8
1 files changed, 5 insertions, 3 deletions
diff --git a/wikiquery b/wikiquery
index 6ff1aae..edf47cc 100755
--- a/wikiquery
+++ b/wikiquery
@@ -10,10 +10,12 @@ version = "0.0.2"
def display(o):
if isinstance(o, list):
- # partially apply the unicode.encode function with appropriate encoding and error handling
- encode = partial(unicode.encode, encoding="utf-8", errors="replace")
- print "'%s'" % "', '".join(map(encode, o))
+ output = []
+ for item in o:
+ output.append(item.encode("utf-8", "replace"))
+
+ print "'%s'" % "', '".join(output)
else:
print o.encode("utf-8", "replace")