wddx problem with entities
Tim Arnold
tiarno at sas.com
Wed Jun 7 09:26:46 EDT 2006
I'm confused about why I get this error:
UnicodeError: ASCII encoding error: ordinal not in range(128)
when I try to load a wddx file containing this string:
<string>The image file, gif/aperçu.png, does
not exist.</string>
When I loop through the file as if it's text and check the ord() value of
each character, of course it's clean. Do I have to replace numbered entities
in the wddx file before I can wddx.load() it?
thanks!
--tim
example program:
-------------------
from xml.marshal import wddx
datastring = '''<?xml version="1.0"?>
<!DOCTYPE wddxPacket SYSTEM "wddx_0090.dtd">
<wddxPacket version="0.9">
<header/>
<data><struct>
<string>The image file, gif/aperçu.png,does not exist.</string>
</struct></data></wddxPacket>'''
data = wddx.loads(datastring)
More information about the Python-list
mailing list