pgsqlodbc utf8 windows?

pgsqlodbc utf8 windows?

am 21.08.2010 05:09:10 von yufeng230

--=-sinamail_alt_57eb64f1bd83ac349f31c9efb75abd75
Content-Type: text/plain;
charset=GBK
Content-Transfer-Encoding: base64
Content-Disposition: inline

aGk6DQpJbiB3aW5kb3dzLEkgc2V0IHBvc3RncmVzcWwgZW5jb2RpbmcgdXRm OCB3aXRoIGNoaW5l
c2UgdGV4dCBpbnNpZGUuCiwgd2hlbiBJIHVzZSBwc3Fsb2RiYy0wOC4wNC4w MjAwIHBzcWxvZGJj
MzV3LmRsbCB0byBjb25uZWN0IHBvc3RncmVzcWwgLGJ1dCBubyBPSyAscmVh ZCB0ZXh0IGVuY29k
aW5nIHdpdGggVUNTMixob3cgdG8gc29sdmUgaXQgPw==


--=-sinamail_alt_57eb64f1bd83ac349f31c9efb75abd75
Content-Type: text/html;
charset=GBK
Content-Transfer-Encoding: base64
Content-Disposition: inline

PFA+aGk6PC9QPg0KPFA+SW4gd2luZG93cyxJIHNldCBwb3N0Z3Jlc3FsIDxG T05UIGNvbG9yPSM1
NTFhOGI+PFU+PEZPTlQgc2l6ZT0zPmVuY29kaW5nIHV0Zjg8L0ZPTlQ+PC9V PjxGT05UIHNpemU9
Mz48Rk9OVCBjb2xvcj0jMDAwMDAwPiB3aXRoIGNoaW5lc2UgdGV4dCBpbnNp ZGUuPEJSPjwvRk9O
VD48VT4sIHdoZW4gSSB1c2UgcHNxbG9kYmMtMDguMDQuMDIwMCBwc3Fsb2Ri YzM1dy5kbGwgdG8g
PC9VPjxGT05UIGNvbG9yPSMwMDAwMDA+Y29ubmVjdCBwb3N0Z3Jlc3FsICxi dXQgbm8gT0sgLHJl
YWQgdGV4dCBlbmNvZGluZyB3aXRoIFVDUzIsaG93IHRvIHNvbHZlIGl0ID88 L0ZPTlQ+PC9GT05U
PjwvRk9OVD48L1A+


--=-sinamail_alt_57eb64f1bd83ac349f31c9efb75abd75--

Re: pgsqlodbc utf8 windows?

am 24.08.2010 04:09:09 von Craig Ringer

On 08/21/2010 11:09 AM, yufeng230@sina.com wrote:
> hi:
>
> In windows,I set postgresql _encoding utf8_ with chinese text inside.
> _, when I use psqlodbc-08.04.0200 psqlodbc35w.dll to _connect postgresql
> ,but no OK ,read text encoding with UCS2,how to solve it ?

UCS2 and utf8 are both unicode encodings. The text should be the same,
just encoded differently. The ODBC driver is converting the UTF-8 it
gets from PostgreSQL into UCS-2, because that's the standard encoding
used by Windows and by the Windows Unicode ODBC driver.

If for some reason you really need UTF-8, you should use the standard
Windows encoding conversion functions, or use libiconv, to convert from
the UCS-2 data you get from the ODBC driver back to UTF-8.

Another option is to install the non-unicode ODBC driver for PostgreSQL,
which will pass whatever the database sends through to do you directly.
That way you should get UTF-8.

--
Craig Ringer

--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc