Re: Escaped backslash in SQL constant - Mailing list pgsql-general

From Tom Lane
Subject Re: Escaped backslash in SQL constant
Date
Msg-id 12050.1135395661@sss.pgh.pa.us
Whole thread Raw
In response to Re: Escaped backslash in SQL constant  ("CN" <cnliou9@fastmail.fm>)
Responses Re: Escaped backslash in SQL constant
List pgsql-general
"CN" <cnliou9@fastmail.fm> writes:
>> Seems to me that you need to fix your broken middleware --- it has no
>> business doing that.

> Are you suggesting that the middleware should not escape backslashes in
> the first place?

No, I'm suggesting that it shouldn't be let loose on Big5 data when it
evidently hasn't a clue about that encoding.  The byte in question
*is not* a backslash, it's not even an independent character; and so
changing it on the assumption that it is logically a backslash simply
breaks the data.

Your quickest route to a solution may be to avoid Big5 in favor of
an encoding that is ASCII-safe, such as UTF8.  You can feed that through
code that only understands ASCII with much less risk than an encoding
where second and later bytes might look like ASCII.

            regards, tom lane

pgsql-general by date:

Previous
From: "CN"
Date:
Subject: Re: Escaped backslash in SQL constant
Next
From: "CN"
Date:
Subject: Re: Escaped backslash in SQL constant