You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'surrogates not allowed' error on stored procedure call for unicode argument #90
cursor.callproc() with unicode string argument generates error below 'utf-8' codec can't encode character '\udceb' in position 39: surrogates not allowed
The code works if I change below code
def literal(self, o):
s = self.escape(o, self.encoders)
if not PY2 and isinstance(s, bytes):
return s.decode('ascii', 'surrogateescape')
return s
to
def literal(self, o):
s = self.escape(o, self.encoders)
if not PY2 and isinstance(s, bytes):
return s.decode('utf8', 'surrogateescape')
return s
changes : 'ascii' to 'utf8'
ps. tested string was korean string, "제권".
It was fixed by #91 .
I cannot remember the details. I think this is closed 3 years ago.
If you are interested in the issue you can digg into the pr above.
Activity
jinto commentedon Jun 8, 2016
I think problem was not in literal(), but in the callproc() after calling literal().
jinto commentedon Apr 24, 2019
It was fixed by #91 .
I cannot remember the details. I think this is closed 3 years ago.
If you are interested in the issue you can digg into the pr above.