Posted by admin on

Unicode in Python

It’s a very long time since I have had to deal with binary code translations, but when dealing with HTML and JSON with Python, I need to get to grips with it. The € symbol for instance requires the extended character set support and rss should be written in utf-8. This page collects the notes I made in learning about Python’s support for unicode/ascii translations.
Here are the links,

  1., the documentation
  2., a bit easier to read.
  3. And docs in 2019,

See also

  2., might be useful if I could get it to wrk


Was HTMLParser/html unavailable 6 years ago? It seems to solve the problem of translating html codes into ascii, sing the unescape function. See displayHTML, which I got from stackoverflow.



Comments ( 3 )

  1. JSON to XML | wiki . davelevy . info
    […] Unicode in Python […]
  2. Dheerendra
    It's not working for me. Komodo has a preblom with the quotes you used and the - symbol you used also when I fixed them it was giving me an errorThis one:Traceback (most recent call last): File C:\Users\Eoin\Documents\Python\EasyGUI\ , line 20, in harv = harv + har[i]['Result'] + + har[i]['FirstURL'] + \n\n'KeyError: Result'
  3. Dave
    I cam across HTMLParser module yesterday, this is a much neater solution, if it works on the ello code, which is what made me write the original piece. The title should be changed, but I may do that another day.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.