Florian Weimer <fw(at)deneb(dot)enyo(dot)de> writes:
> Uh-oh, this is my fault. PQescapeString should escape all characters
> greater than 126.
No, that doesn't work, because the de-escaping on the backend side
happens *after* conversion to the backend encoding. If you insert escapes
into the middle of multibyte characters then you break the conversion.
Tatsuo's description of the problem is accurate (though I'm not sure
I agree with his solution ;-))
regards, tom lane