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