I’m getting some facebook posts that have a mixture of English and and a non-English language (Khmer to be exact).
Here’s how the non-English is displayed when I print the data to screen or save it to file: u178au17c2u179bu1787u17b6u17a2u17d2. I would rather have it display as ឈឹម បញ្ចពណ៌ (Note: this is not a translation of the previous unicode.)
3
Answers
In pycharm I added:
(at top) # -- coding: utf-8 --
import sys reload(sys) sys.setdefaultencoding('utf8')
This should be it:
Output: ជាអ្
Try this if you want to save the info in a file: