pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsqlodbc utf8 windows?
2+ messages / 2 participants
[nested] [flat]

* pgsqlodbc utf8 windows?
@ 2010-08-21 03:09 yufeng230@sina.com
  2010-08-24 02:09 ` Re: pgsqlodbc utf8 windows? Craig Ringer <craig@postnewspapers.com.au>
  0 siblings, 1 reply; 2+ messages in thread

From: yufeng230@sina.com @ 2010-08-21 03:09 UTC (permalink / raw)
  To: pgsql-odbc

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 ?

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pgsqlodbc utf8 windows?
  2010-08-21 03:09 pgsqlodbc utf8 windows? yufeng230@sina.com
@ 2010-08-24 02:09 ` Craig Ringer <craig@postnewspapers.com.au>
  0 siblings, 0 replies; 2+ messages in thread

From: Craig Ringer @ 2010-08-24 02:09 UTC (permalink / raw)
  To: yufeng230@sina.com; +Cc: pgsql-odbc

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2010-08-24 02:09 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-08-21 03:09 pgsqlodbc utf8 windows? yufeng230@sina.com
2010-08-24 02:09 ` Craig Ringer <craig@postnewspapers.com.au>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox