UnicodeDecodeError saving Page Template
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Low
|
Andreas Jung |
Bug Description
We user koi8-r enconding in zope. management_
After instaling zope 2.10.2 we added environment variable ZPT_PREFERRED_
Rendering of page templates works fine, but when i try to change page template with cyrillic charactres in text or title, I getting an error:
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-3: invalid data
The error is in lines 193-194 of /Products/
# The ZMI edit view uses utf-8! So we can safely assume
# that 'title' and 'text' are utf-8 encoded strings - hopefully
text = unicode(text, 'utf-8')
Indeed The ZMI edit view uses utf-8 only if management_
Replacing string
text = unicode(text, 'utf-8')
to
text, encoding = convertToUnicod
solved the problem.
Diff file fo ZopePageTemplate.py attached.
Changed in zope2: | |
assignee: | nobody → ajung |
Changed in zope2: | |
importance: | Medium → Low |
status: | New → Triaged |
Could you please work on a unittest?