[Product-Developers] Error with cropText and non-breaking spaces ( ) in Description
david.bain at alteroo.com
Thu Mar 6 16:51:56 UTC 2008
I've created a product which uses the BodyText as the Description.
This causes a problem with plone's cropText method, it seems to
"choke" when a Description contains a non breaking space.
Based on my research, it seems that utf-8 has issues with the
non-breaking space character.
The error I kept getting looked like: UnicodeDecodeError 'utf8'
codec can't decode byte 0xa0 in position 136: unexpected code byte
This is not a typical situation, since Description text, by default,
never has any html or html encoding.
Worth noting in case that someone else has a need for cropText with
HTML that contains non-breaking spaces.
More information about the Product-Developers