diff options
-rwxr-xr-x | wikiquery | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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") |