Re: [Zope] Using tal:attributes in XML with non-ASCII characters

2006-03-20 Thread Chris Withers
Andrew Veitch wrote: Error Type: UnicodeDecodeError Error Value: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128) If I change the input line to: Then this will work in HTML mode but will fail in XML mode. This all sounds familiar. I remember having loads of fu

Re: [Zope] Using tal:attributes in XML with non-ASCII characters

2006-03-20 Thread Dieter Maurer
Andrew Veitch wrote at 2006-3-20 01:53 +: > ... > >This gives: > >Error Type: UnicodeDecodeError >Error Value: 'ascii' codec can't decode byte 0x80 in position 0: >ordinal not in range(128) Sure, you are using "str.encode" in a wrong way: "str.encode('uft-8')" is equivalent to "uni

Re: [Zope] Using tal:attributes in XML with non-ASCII characters

2006-03-19 Thread Andrew Veitch
On 19 Mar 2006, at 19:11, Dieter Maurer wrote: This means that almost surely your "non-ascii" was not encoded in UTF-8. Encode them this way and it will work. Here's a test template that I created through the ZMI: http://xml.zope.org/namespaces/tal"; tal:define="dummy python:request.RES

Re: [Zope] Using tal:attributes in XML with non-ASCII characters

2006-03-19 Thread Dieter Maurer
Andrew Veitch wrote at 2006-3-18 15:56 +: >I'm just trying to think of a way of using tal:attributes with non- >ASCII characters using the XML parser. > >At first, I just used a straight tal:attributes with the encoding of >the template set to UTF-8 but that threw an expat error. This means

[Zope] Using tal:attributes in XML with non-ASCII characters

2006-03-18 Thread Andrew Veitch
I'm just trying to think of a way of using tal:attributes with non- ASCII characters using the XML parser. At first, I just used a straight tal:attributes with the encoding of the template set to UTF-8 but that threw an expat error. My second attempt was to write a function which replaced al