[Zope-dev] Yet more unicode and page template weirdness

Marius Gedminas marius at gedmin.as
Wed Oct 13 08:47:13 EDT 2010


On Wed, Oct 13, 2010 at 08:53:08AM +0100, Chris Withers wrote:
> Hi All,
> 
> In Zope 2.12, try putting the following in a TTW ZPT:
> 
> <tal:c content="&#8250;"/>

Are you sure you didn't mean

  <tal:c content="string:&#8250;"/>

?  Because I am pretty sure your TALES namespace does not contain
a variable named "›".

> ...nothing more, nothing less.
> 
> On save, I get:
> 
> Compilation failed
> <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode 
> character u'\u203a' in position 0: ordinal not in range(128)
...
> Any ideas where the non-ascii character is in the above?

&#8250; is the non-ASCII character, obviously.

The way XML works, all entities in an attribute value are decoded before
being interpreted, so your TALES interpreter gets an expression
u'\u203a' which it then fails to interpret.

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20101013/6b05d4ac/attachment.bin 


More information about the Zope-Dev mailing list