lento / spam

Spark Project & Asset Manager
GNU General Public License v3.0
7 stars 2 forks source link

non unicode characters #44

Open MrPetru opened 12 years ago

MrPetru commented 12 years ago

spam don't handle the non unicode character for example when a user insert a symbol like "à, ò, è, é, ù, ì" in asset comment the spam give an error like: ordinal non in range(128) and all asset for that categories are not visualized.

MrPetru commented 12 years ago

How you can see here https://github.com/MrPetru/spam/blob/master/spam/model/misc.py#L191 the type of "text" is UnicodeString and, in this place https://github.com/MrPetru/spam/blob/master/spam/controllers/asset/main.py#L173 the comment is passed to text property without decode it to unicode.

maybe we should use this: text = '[%s v000]\n%s' % (('created'), comment or '').decode('utf-8') in place of this: text = '[%s v000]\n%s' % (('created'), comment or '')