"CN" <cnliou9@fastmail.fm> writes:
> The database cluster is initialized to use UNICODE. The client encoding
> is set to BIG5. The middleware escapes the backslash in the following
> string before writing to TEXT/VARCHAR column in server:
> a5 5c af e0
Seems to me that you need to fix your broken middleware --- it has no
business doing that.
> This is a string comprises Big5 characters each of 2 octets big. Note
> that the second octets, 5c, of the first Big5 character clashes
> backslash '\'. Thus, this string is escaped to
> a5 5c 31 33 34 af e0
Now you have a 2-octet Big5 character, followed by 3 1-octet ASCII
digits, followed by a 2-octet Big5 character. All the subsequent
processing is doing what it should with this, AFAICS.
regards, tom lane