handling parsed Hebrew string. - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: handling parsed Hebrew string. (/showthread.php?tid=108943) |
[solved]handling parsed Hebrew string. - yotama9 - 2011-08-29 Hi. In this code segment for parsing http://www.mako.co.il/mako-vod-index: Code: soup = BeautifulStoneSoup(link, convertEntities=BeautifulStoneSoup.XML_ENTITIES) The result is unicode code and not hebrew character. when reading the log file, or adding a string I have generated using join to a directory I see [u'\u05ea\u05d0\u05de\u05d9\u05df \u05dc\u05d9'] and not the Hebrew text I want. How to fix this? Thanks - t0mm0 - 2011-08-29 yotama9 Wrote:Hi. it already is a unicode string. you may need to encode it to utf-8 Code: >>> print u'\u05ea\u05d0\u05de\u05d9\u05df \u05dc\u05d9'.encode('utf-8') - yotama9 - 2011-08-30 once again, t0mm0 to the rescue. Thanks. |