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

Popular posts from this blog

mod rewrite - Using "?" when rewriting the URL -

.htaccess: Transfer name to index.php if not directory public -

Admob integration with pygame in android -