[Twisted-Python] unicode for pyPgSQL

Pet petshmidt at googlemail.com
Thu Aug 13 03:02:35 EDT 2009


On Wed, Aug 12, 2009 at 6:51 PM, <exarkun at twistedmatrix.com> wrote:
> On 03:28 pm, petshmidt at googlemail.com wrote:
>>Hello,
>>
>>does pyPgSQL doesn't support unicode?
>>
>>execute(query, params) #all items in params list are of  <type
>>'unicode'>
>>
>>I'm getting
>>'ascii' codec can't encode character u'\xfc' in position 1: ordinal
>>not in range(128)
>>
>>Do I need encode my params before sending a query and then decode all
>>results back to unicode?
>
> I don't know about pyPgSQL's unicode support.
>
> I did recently learn that pyPgSQL doesn't support bind parameters,
> apparently resulting in almost any use of it insecure and vulnerable to
> SQL injection attacks.  You may want to investigate this further before
> deciding if it's worth figuring out how unicode works.


That's interesting. May be I should try psycorg2.
By the way, pyPgSQL has no problem with unicode, the problem was elsewhere

>
> Jean-Paul
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>



More information about the Twisted-Python mailing list