pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Iain <iain@mst.co.jp>
To: Layet Benjamin <benjamin@moonfactory.co.jp>
To: pgsql-odbc@postgresql.org
Subject: Re: ODBC & character encoding
Date: Mon, 7 Feb 2005 17:31:21 +0900
Message-ID: <002501c50cef$6a46f780$7201a8c0@mst1x5r347kymb> (raw)
References: <002501c50ce3$37edad80$9285a8c0@moonfactory.co.jp>
	<001301c50ce7$6a23ffd0$7201a8c0@mst1x5r347kymb>
	<005101c50ceb$ee3f7070$9285a8c0@moonfactory.co.jp>

Hi Benjamin,

I don't have direct experience of your exact situation, but I use a 7.1 
database via ODBC. The difference is that the client is not unicode, it's 
plain old windows shift-JIS and that works fine iff you use the unicode 
support odbc driver. When you install the postgres ODBC driver it actually 
contains 3 drivers, which one are you using?

> Can the ODBC driver convert the query string from UTF8 to EUC_JP before 
> sending it to the database server ?

I'm not sure...

> Can the ODBC driver take EUC_JP string as input ? (then I would 'just' 
> have to figure out how to send EUC_JP stings from C#...)

I dunno about that either, but it certainly accepts shift-JIS which is the 
native encoding for windows.

So far I've never had to pay much attention to client encoding (with the 
notable exception of getting input data from a web application) as the 
clients and drivers seem to work everything out by themselves.

Regards
Iain


  ----- Original Message ----- 
  From: Layet Benjamin
  To: Iain ; pgsql-odbc@postgresql.org
  Sent: Monday, February 07, 2005 5:06 PM
  Subject: Re: [ODBC] ODBC & character encoding


  Hi,
  Thank you Iain for your quick reply.
  But unfortunately this did not solve the problem, 7.1 does not support 
this conversion neither yet. (7.3 and 7.4 do):

  SET client_encoding='UNICODE';
  ERROR:  Conversion between UNICODE and EUC_JP is not supported

  In theory, I have 3 possible places to convert UTF8 to EUC_JP:
  - 1 inside postgres
  - 2 inside ODBC
  - 3 inside C#


  1

          C#                                    ODBC 
Postgres 7.1
  Utf8                  l =============>  l                l =====>l 
UTF8->EUC_JP
  (possible->Unicode)   l     UTF8        l                l UTF8  l
  ______________________l  (or Unicode)   l________________l 
l_______________


  2
          C#                                    ODBC 
Postgres 7.1
  Utf8                  l =============>  l UTF8->EUC_JP   l =====>l
  (possible->Unicode)   l     UTF8        l                l EUC_JPl
  ______________________l  (or Unicode)   l________________l 
l_______________


  3

          C#                                    ODBC 
Postgres 7.1
  UTF8->EUC_JP          l =============>  l                l =====>l
  (possible->Unicode)   l     EUC_JP      l                l EUC_JPl
  ______________________l                 l________________l 
l_______________


  Number 1 seem to be the normal solution, but it does not work with 7.1.
  I would like to know if number 2 or 3 are possible:
  so,
   - Can the ODBC driver convert the query string from UTF8 to EUC_JP before 
sending it to the database server ?
  or
  - Can the ODBC driver take EUC_JP string as input ? (then I would 'just' 
have to figure out how to send EUC_JP stings from C#...)

  Help extremely needed...
  Thank you !

  Benjamin

view thread (5+ messages)  latest in thread

Message-ID: <002501c50cef$6a46f780$7201a8c0@mst1x5r347kymb>
Permalink:  ../002501c50cef$6a46f780$7201a8c0@mst1x5r347kymb/
Also on:    postgresql.org/message-id/002501c50cef$6a46f780$7201a8c0@mst1x5r347kymb

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: iain@mst.co.jp, benjamin@moonfactory.co.jp
  Subject: Re: ODBC & character encoding
  In-Reply-To: <002501c50cef$6a46f780$7201a8c0@mst1x5r347kymb>
  References: <002501c50ce3$37edad80$9285a8c0@moonfactory.co.jp> <001301c50ce7$6a23ffd0$7201a8c0@mst1x5r347kymb> <005101c50ceb$ee3f7070$9285a8c0@moonfactory.co.jp> <002501c50cef$6a46f780$7201a8c0@mst1x5r347kymb>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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