convert strings in separate lists to unicode - python -
what's best way convert every string in list (containing other lists) unicode in python?
for example:
[['a','b'], ['c','d']]
to
[[u'a', u'b'], [u'c', u'd']]
>>> li = [['a','b'], ['c','d']] >>> [[v.decode("utf-8") v in elem] elem in li] [[u'a', u'b'], [u'c', u'd']]
Comments
Post a Comment