This is an issue with python. By default python stores strings
internally as ascii. When you come across a non-ascii character (see
http://extra.shu.ac.uk/emls/emlschar.html for examples) it throws a
wobbly. I think one of the newer versions of python addresses this
(3... but don't quote me on that). One of the things you can do is
insist that characters are stored in unicode. I think (and I'm no
python guru so someone else might be able to offer better solutions
but this should get you started) using...

a = u'some text with non-unicode chars in it'

or...

a = unicode('some text with non-unicode chars in it', 'utf-8')


python will decode this correctly for you. If you want a quick test on
the terminal tap this in and you can see an example(I don't have
python installed on this machine, but it should work)....

print 'Á'
#this will return /abc or something that does not represent what you
want

print u'Á'
print unicode('Á', 'utf-8')
#this will return 'Á'

Hope this helps :)

On Nov 30, 3:23 pm, Wookai <vincent.et...@gmail.com> wrote:
> Hum, I actually searched a bit more and found a reference to issue
> 332 :http://code.google.com/p/google-wave-resources/issues/detail?id=332
>
> So I guess the problem is not on my side, finally ;) !
>
> On Nov 30, 10:21 am, Wookai <vincent.et...@gmail.com> wrote:
>
>
>
> > I get a lot of the following errors in the appengine logs :
>
> > # 10.230.66.151 - - [30/Nov/2009:05:48:52 -0800] "POST /_wave/robot/
> > jsonrpc HTTP/1.1" 500 124 - "WaveRobotGateway,gzip(gfe)"
> > "imdbotty.appspot.com"
>
> > # E 11-30 05:48AM 52.572
>
> > 'ascii' codec can't encode character u'\xf1' in position 9: ordinal
> > not in range(128)
> > Traceback (most recent call last):
> >   File "/base/python_lib/versions/1/google/appengine/ext/webapp/
> > __init__.py", line 509, in __call__
> >     handler.post(*groups)
> >   File "/base/data/home/apps/imdbotty/1.337970269170781095/waveapi/
> > robot.py", line 90, in post
> >     context, events = robot_abstract.ParseJSONBody(json_body)
> >   File "/base/data/home/apps/imdbotty/1.337970269170781095/waveapi/
> > robot_abstract.py", line 37, in ParseJSONBody
> >     context = ops.CreateContext(data)
> >   File "/base/data/home/apps/imdbotty/1.337970269170781095/waveapi/
> > ops.py", line 595, in CreateContext
> >     context.AddBlip(raw_blip_data)
> >   File "/base/data/home/apps/imdbotty/1.337970269170781095/waveapi/
> > ops.py", line 552, in AddBlip
> >     blip = OpBasedBlip(blip_data, self)
> >   File "/base/data/home/apps/imdbotty/1.337970269170781095/waveapi/
> > ops.py", line 186, in __init__
> >     super(OpBasedBlip, self).__init__(json)
> >   File "/base/data/home/apps/imdbotty/1.337970269170781095/waveapi/
> > model.py", line 192, in __init__
> >     self.elements[elem] = document.ElementFromJson(json_elements
> > [elem])
> >   File "/base/data/home/apps/imdbotty/1.337970269170781095/waveapi/
> > document.py", line 204, in ElementFromJson
> >     return Gadget(url=url, props=props)
> >   File "/base/data/home/apps/imdbotty/1.337970269170781095/waveapi/
> > document.py", line 164, in __init__
> >     super(Gadget, self).__init__(ELEMENT_TYPE.GADGET,
> > properties=props)
> >   File "/base/data/home/apps/imdbotty/1.337970269170781095/waveapi/
> > document.py", line 120, in __init__
> >     setattr(self, key, val)
> > UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in
> > position 9: ordinal not in range(128)
>
> > By loooking at the stack trace, the error seems not to come from my
> > code, but I guess I should be doing something wrong ?

--

You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to google-wave-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en.


Reply via email to