2009/3/21 AchipA <[email protected]>
>
> >I was hoping that web2py could transparently communicate with
> >databases that are UTF8 encoded and that I would be able to do
> >operations on strings retrieved from databases without thinking about
> >their encodings.
>
> That is the goal. It will never be 100% as it is somewhat dabase/
> version dependant. As you yourself write, it uses utf-8 encoded
> strings (which is the python 2.x norm and this won't change to unicode
> objects at least until web2py support for Python 3.0 arrives) and uses
> utf8 data in the database. That being told, a quick glance at the
> IS_LENGTH validator shows that it might not be entirely correctly
> using len(), I think Massimo should take a look at it.
agree...
>
> >>> len('a')
> 1
> >>> len('á')
> 2
> >>> len(u'á')
> 1
> >>> len('á'.decode('utf-8'))
> 1
>
thanks...
-y
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---