summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwikiquery5
1 files changed, 4 insertions, 1 deletions
diff --git a/wikiquery b/wikiquery
index 91b68ad..41d8ba7 100755
--- a/wikiquery
+++ b/wikiquery
@@ -10,7 +10,10 @@ version = "0.0.2"
def display(o):
if isinstance(o, list):
- print "'%s'" % "', '".join(map(partial(unicode.encode, encoding="utf-8", errors="replace"), o))
+ # 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))
else:
print o.encode("utf-8", "replace")