"Bruno Silva" <[EMAIL PROTECTED]> writes:
> I'm sorry to be a pain, but can you explain this to me?
> in WebConsole:
>>>> ps = Project.select(AND(Project.q.userID == 1, Project.q.name == 'cão'))
>>>> ps.count()
> 0L
>>>> ps = Project.select(AND(Project.q.userID == 1, Project.q.name ==
> u'cão'))
>>>> ps.count()
> Traceback (most recent call last):
> ........
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position
> 80: ordinal not in range(128)
>>>> ps = Project.select(AND(Project.q.userID == 1, Project.q.name ==
> u'cão'.encode('utf-8')))
>>>> ps.count()
> 0L
SQLObject only deals with encoded strings. It doesn't pass unicode around.
At least that was what I read recently here on this ML (if you check recent
archives you'll see it).
But you can try something like:
my_constraint = u'cão'
ps = Project.select(... Project.q.name == my_constraint)
It should work.
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---