Re: [ODBC] UTF-8 data migration problem in Postgresql 7.2
Tatsuo Ishii <t-ishii@sra.co.jp>
From: Tatsuo Ishii <t-ishii@sra.co.jp>
To: jm.poure@freesurf.fr
Cc: pgsql-hackers@postgresql.org, pgsql-odbc@postgresql.org, Inoue@tpf.co.jp
Date: 2002-02-22T09:23:10Z
Lists: pgsql-hackers
> I guess the error might come from PostgreSQL string parsing functions: > 1) new.target_content:= translate(new.target_content, chr(146), chr (39)) ; > 2) substring(text, int4). Is substring multibyte safe? Oh, I think I found the source of the problem. Apparently you did 1) above in PostgreSQL 7.1.3, right? 7.1's translate is not multibyte aware, so it simply replaces every occurence of chr(146) = 0x92 to chr(39) = 0x27 even if it's part of the multibyte sequece. The broken seqneuce was E3/82/27, which is apparently replaced by translate() from E3/82/92. -- Tatsuo Ishii