{"action":"opened","issue":{"number":11,"created_at":"2011-10-11T14:50:43Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"At the moment Features store text attributes in std::string (in client encoding) and only transcoded to wide-strings (UCS-2) during rendering. This causes a problem with Python bindings exposing Features text properties in other then ASCII e.g.:\r\n\r\n{{{\r\n>>> from mapnik import *\r\n>>> ds = Shapefile(file='./demo/data/boundaries')\r\n>>> pt  = ds.envelope().center()\r\n>>> fs = ds.features_at_point(pt)\r\n>>> f = fs.next()\r\n>>> name = str(f.properties['NOM_FR']) \r\n>>> name\r\n'Qu\\xe9bec'\r\n>>> print name \r\nQu�ec\r\n>>> name_unicode = unicode(name,'Latin1')  # we know it's in Latin1 \r\n>>> name_unicode\r\nu'Qu\\xe9bec'\r\n>>> print name_unicode\r\nQuébec\r\n}}}\r\n  \r\nOne way to address this is to convert to and store text attributes as Unicode (UCS-2). In Python  bindings we can provide 'unicode' method to access std::wstring as a Python Unicode.\r\n\r\n\r\n{{{\r\n>>> name = f.properties['NOM_FR'].unicode() # name is Python Unicode \r\n>>> name\r\nu'Qu\\xe9bec'\r\n>>> print name\r\nQuébec\r\n}}}","comments":0,"title":"Mapnik Unicode support","updated_at":"2011-10-11T14:50:43Z","url":"https://api.github.com/repos/artemp/tickets2issues/issues/11","id":1875547,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/941f68386168a8a6b60f2529a7830af7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/artemp","id":59056,"login":"artemp"},"html_url":"https://github.com/artemp/tickets2issues/issues/11","labels":[{"name":"Boost_Python_Binding","url":"https://api.github.com/repos/artemp/tickets2issues/labels/Boost_Python_Binding","color":"FFFFFF"}],"state":"open"},"legacy":{"number":11,"action":"opened","issue":1875547}}