{"id":2710,"date":"2015-07-05T19:59:00","date_gmt":"2015-07-05T19:59:00","guid":{"rendered":"http:\/\/wiki.davelevy.info\/?p=2710"},"modified":"2019-12-26T10:14:25","modified_gmt":"2019-12-26T10:14:25","slug":"unicode-in-python","status":"publish","type":"post","link":"https:\/\/davelevy.info\/wiki\/unicode-in-python\/","title":{"rendered":"Unicode in Python"},"content":{"rendered":"<p>It&#8217;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 \u20ac 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&#8217;s support for unicode\/ascii translations.<!--more--><\/p>\n<p>Here are the links,<\/p>\n<ol>\n<li><a href=\"https:\/\/docs.python.org\/2\/howto\/unicode.html\">https:\/\/docs.python.org\/2\/howto\/unicode.html<\/a>, the documentation<\/li>\n<li><a href=\"https:\/\/web.archive.org\/web\/20181221172931\/https:\/\/www.pythoncentral.io\/python-unicode-encode-decode-strings-python-2x\/\">http:\/\/www.pythoncentral.io\/python-unicode-encode-decode-strings-python-2x\/<\/a>, a bit easier to read.<\/li>\n<li>And docs in 2019,\u00a0https:\/\/www.pythoncentral.io\/python-unicode-encode-decode-strings-python-2x\/<\/li>\n<\/ol>\n<p>See also<\/p>\n<ol>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/15237702\/python-unicode-encode-error-ordinal-not-in-range128-with-euro-sign\">http:\/\/stackoverflow.com\/questions\/15237702\/python-unicode-encode-error-ordinal-not-in-range128-with-euro-sign<\/a><\/li>\n<li><a href=\"http:\/\/farmdev.com\/talks\/unicode\/\">http:\/\/farmdev.com\/talks\/unicode\/<\/a>, might be useful if I could get it to wrk<\/li>\n<\/ol>\n<h3>HTML<\/h3>\n<p>Was HTMLParser\/html unavailable 6 years ago? It seems to solve the problem of translating html codes into ascii, sing the <code>unescape<\/code>\u00a0function. See <a href=\"https:\/\/github.com\/dfl1955\/ello2rss\/blob\/master\/displayHTML.py\">displayHTML<\/a>, which I <a href=\"https:\/\/stackoverflow.com\/questions\/2087370\/decode-html-entities-in-python-string\">got from stackoverflow<\/a>.<\/p>\n<p style=\"text-align: center;\">ooOOOoo<\/p>\n<p>SURL:\u00a0https:\/\/wp.me\/pauVx4-HI<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;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 \u20ac symbol for instance requires the extended character set support and rss should be written in utf-8. This page collects the notes&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2713,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_share_on_mastodon":"0"},"categories":[3],"tags":[253,36,45,911,1381],"class_list":["post-2710","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-html","tag-programming","tag-python","tag-technology","tag-unicode"],"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2015\/07\/unicode-rotw650.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/2710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/comments?post=2710"}],"version-history":[{"count":2,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/2710\/revisions"}],"predecessor-version":[{"id":4691,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/2710\/revisions\/4691"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media\/2713"}],"wp:attachment":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media?parent=2710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/categories?post=2710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/tags?post=2710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}