If I want to display Unicode elements as string correctly, why should I do, in the English language?
Asked
Active
Viewed 67 times
-5
-
1Can you show me an example of what you mean? – Kent Shikama Dec 25 '17 at 08:30
-
Could you convert my_list from Unicode to string? my_list=[[u'', u'', u'', u'', u'', u'', u'', u'', u'', u'', u'', u'', u'', u'An efficient genetic algorithm for large-scale planning of dense and robust industrial wireless networks', u'Gong, X., Plets, D., Tanghe, E., (...), Martens, L., Joseph, W.'] – Hamed Baziyad Dec 25 '17 at 08:54
-
Possible duplicate of [convert selenium webelelements to list of strings in python](https://stackoverflow.com/questions/47959991/convert-selenium-webelelements-to-list-of-strings-in-python) – undetected Selenium Dec 25 '17 at 09:23
-
@hamedbaziyad Can you show your code trials? How is it related to `Selenium`? – undetected Selenium Dec 25 '17 at 09:24
1 Answers
2
I suppose you can encode each item one by one into utf-8 if thats what you wanted.
list = [u"hi",u"Whatever",u"Hello"]
map(lambda item: item.encode("utf-8"), list)
Outputs
['hi', 'Whatever', 'Hello']
See the following for more details on the map function. You can also just use python3 if thats an option.

Kent Shikama
- 3,910
- 3
- 22
- 55