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

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -