Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 415231337BD1 for ; Mon, 4 Apr 2011 10:49:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 57803-05-5 for ; Mon, 4 Apr 2011 13:49:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from vserver0403.onit4u.de (vserver0403.onit4u.de [213.133.112.9]) by mail.postgresql.org (Postfix) with SMTP id 1B57B1337C39 for ; Mon, 4 Apr 2011 10:48:21 -0300 (ADT) X-PDA-ORIGIN: vserver0403.onit4u.de Received: (qmail 14165 invoked from network); 4 Apr 2011 13:34:28 -0000 Received: by simscan 1.4.0 ppid: 14068, pid: 14157, t: 0.4501s scanners: clamav: 0.96.5/m:47/d:12943 Received: from unknown (HELO ?192.168.10.102?) (josefspa@88.65.248.24) by vserver0403.onit4u.de with SMTP; 4 Apr 2011 13:34:28 -0000 Message-ID: <4D99CC03.2020509@joops.com> Date: Mon, 04 Apr 2011 15:47:47 +0200 From: Josef Springer User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Hiroshi Inoue CC: pgsql-odbc@postgresql.org Subject: Re: 08.02.04.00 Updating column with Unicode References: <4D985F14.7050108@joops.com> <4D99C535.7030704@tpf.co.jp> In-Reply-To: <4D99C535.7030704@tpf.co.jp> Content-Type: multipart/alternative; boundary="------------070803080908070505080102" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201104/5 X-Sequence-Number: 10633 This is a multi-part message in MIME format. --------------070803080908070505080102 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Hiroshi, the parameters are bound as an UTF8-encoded bytearray. Because the interface is controlled by a Smalltalk application, i think the codings does not help you: /bytes := v asByteArrayEncoding: #'utf-8'. p copyAt: 0 from: bytes size: (size := bytes size) startingAt: 1. p at: size put: 0 / Josef Springer Hiroshi Inoue wrote: > (2011/04/03 20:50), Josef Springer wrote: >> Hello everybody, >> >> I have detected some strange behavior updating columns with Unicodes >> strings. >> >> Environment: >> PostgreSQL 8.2.5 >> Database encoding: UTF8 >> ODBC: PostgreSQL Unicode Version 08.02.04.00 >> >> I am updating via ODBC a column (character varying nnn) of a record to >> an unicoded string. >> >> Updating by using the command as one parameterblock >> 'UPDATE adresse SET company = ''Seifert und Partner KG € 文件'' WHERE id >> = 1' >> works right. (the whole parameterblock is encoded to UTF8) >> >> Updating the record by using the command 'UPDATE adresse SET company=? >> WHERE record.id=?' >> and providing the arguments for ? UTF8-encoded in an extra buffer >> destroys the columns content. >> >> If i update the column with an UTF8 encoded character in the default >> range (the EURO Sign €), it works. >> >> Can anybody give me some hints ? > > How do you bind the parameters? > > regards, > Hiroshi Inoue > > --------------070803080908070505080102 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Hiroshi,

the parameters are bound as an UTF8-encoded bytearray. Because the interface is controlled by a Smalltalk application, i think the codings does not help you:
bytes := v asByteArrayEncoding: #'utf-8'.
p copyAt: 0 from: bytes size: (size := bytes size) startingAt: 1.
p at: size put: 0

Josef Springer

Hiroshi Inoue wrote:
(2011/04/03 20:50), Josef Springer wrote:
Hello everybody,

I have detected some strange behavior updating columns with Unicodes
strings.

Environment:
PostgreSQL 8.2.5
Database encoding: UTF8
ODBC: PostgreSQL Unicode Version 08.02.04.00

I am updating via ODBC a column (character varying nnn) of a record to
an unicoded string.

Updating by using the command as one parameterblock
'UPDATE adresse SET company = ''Seifert und Partner KG € 文件'' WHERE id
= 1'
works right. (the whole parameterblock is encoded to UTF8)

Updating the record by using the command 'UPDATE adresse SET company=?
WHERE record.id=?'
and providing the arguments for ? UTF8-encoded in an extra buffer
destroys the columns content.

If i update the column with an UTF8 encoded character in the default
range (the EURO Sign €), it works.

Can anybody give me some hints ?

How do you bind the parameters?

regards,
Hiroshi Inoue


--------------070803080908070505080102--