Re: Escaped backslash in SQL constant

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "CN" <cnliou9(at)fastmail(dot)fm>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Escaped backslash in SQL constant
Date: 2005-12-24 03:41:01
Message-ID: 12050.1135395661@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"CN" <cnliou9(at)fastmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message CN 2005-12-24 04:14:19 Re: Escaped backslash in SQL constant
Previous Message CN 2005-12-24 03:20:25 Re: Escaped backslash in SQL constant