Hi Massimo,

Thanks for the quick reply. I'd be ok with utf8 strings, it's just
that the DAL returned a unicode string, not utf8. So the code was
extra complicated by having to convert all data from the DAL to utf8
strings in order not to crash the xml web service.

I've really enjoyed working with web2py. Thanks for making it happen!

Cheers,

Clayton

On Sep 30, 1:29 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I would not call this a bug because as a rule web2py supports only
> utf8 strings. Yet sometime unicode works just fine.
> I'd call this a suggestion for improvement and I will take a look into
> it. I am sure It can be done.
>
> Massimo
>
> On Sep 30, 11:54 am, Clayton <clayton.grass...@gmail.com> wrote:
>
>
>
>
>
>
>
> > The following crashes with ascii encoding error:
>
> > @service.xml
> > def test():
> >     return dict(test=u'K\u00E5')
>
> > It fails with "UnicodeEncodeError: 'ascii' codec can't encode
> > character u'\xe5' in position 1: ordinal not in range(128)" when the
> > service is called.
>
> > The following succeeds:
>
> > @service.xml
> > def test():
> >     return dict(test=u'K\u00E5'.encode('utf-8'))
>
> > Now the DAL returns unicode strings just fine, but when I try to
> > return them from a web service, it crashes due to this bug.
>
> > The bug seems to be at line 21 of serializers.py as far as I can tell,
> > as it doesn't deal with unicode type.
>
> > Thanks!
>
> > Clayton

Reply via email to