I guess the question is whether the str() conversion should be done at the DAL level so databases that support unicode just pass through, and we do str() for those that don't. This will especially be a consideration with regard to plans for Python 3000 migration as str is deprecated there.
On Feb 21, 5:57 am, mdipierro <[email protected]> wrote: > No because not all databases support them thus would not be portable. > > Strings bust me UTF8 encoded. > > Massimo > > On Feb 20, 8:13 pm, Miguel Goncalves <[email protected]> > wrote: > > > Hi > > > When I call the following code : > > > import gluon.contrib.simplejson as json > > > def create(): > > ###http://..../create?fields=<fields in json> > > va = dict( json.loads(request.vars.fields, encoding='ascii' ) > > ) > > return db.book.insert(**va) > > > With the > > url:http://localhost:8000/welcome/service/create?fields={"2brief_description":"ivre", > > "Author":"Pucette", "book_id":90} > > > I get the error: > > > db.book.insert(**va) > > TypeError: insert() keywords must be strings > > > Any way to make the insert function work with unicode strings? > > this works perfectly if I do the following (convert the keywords to > > ascii strings): > > > vo = dict() > > for k in va: > > vo[str(k)] = va[k] > > > return db.book.insert(**vo) > > > Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

