X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C2FEB8B9C51 for ; Mon, 7 Feb 2005 09:53:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 27231-07 for ; Mon, 7 Feb 2005 09:53:31 +0000 (GMT) Received: from moonfactory.co.jp (vwall.moonfactory.co.jp [211.5.120.193]) by svr1.postgresql.org (Postfix) with ESMTP id 515A28B9B6B for ; Mon, 7 Feb 2005 09:53:31 +0000 (GMT) Received: from benjamindon (192.168.133.146) by moonfactory.co.jp with ESMTP (Eudora Internet Mail Server 3.0.3); Mon, 7 Feb 2005 18:53:31 +0900 Message-ID: <003401c50cfa$e1042630$9285a8c0@moonfactory.co.jp> From: "Layet Benjamin" To: "Iain" , References: <002501c50ce3$37edad80$9285a8c0@moonfactory.co.jp> <001301c50ce7$6a23ffd0$7201a8c0@mst1x5r347kymb> <005101c50ceb$ee3f7070$9285a8c0@moonfactory.co.jp> <002501c50cef$6a46f780$7201a8c0@mst1x5r347kymb> Subject: Re: ODBC & character encoding Date: Mon, 7 Feb 2005 18:53:30 +0900 Organization: Moonfactory MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0030_01C50D46.50A1F3F0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.043 tagged_above=0 required=5 tests=AWL, HTML_60_70, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200502/29 X-Sequence-Number: 4919 This is a multi-part message in MIME format. ------=_NextPart_000_0030_01C50D46.50A1F3F0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Hi Iain, Thank you again for your reply. It's good to know that things works for people almost in my situation :-). I am not surprise that there is no problem with Shift-Jis, since "SET client_encoding= 'SJIS';" works fine on a EUC_JP database. But "SET client_encoding= 'UNICODE';" does not work with 7.1.... and I feel really stuck because of that... >When you install the postgres ODBC driver it actually contains 3 drivers, >which one are you using? I tried the PostgreSQL 8.00. and PostgreSQL Unicode beta but both of them try to do "SET client_encoding= 'UNICODE'"... In my case, I really need to convert the encoding before sending it to Postgres... but I don't know if it is possible. >So far I've never had to pay much attention to client encoding... Lucky man :-) Cheers, Ben ----- Original Message ----- From: Iain To: Layet Benjamin ; pgsql-odbc@postgresql.org Sent: Monday, February 07, 2005 5:31 PM Subject: Re: [ODBC] ODBC & character encoding 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 ------=_NextPart_000_0030_01C50D46.50A1F3F0 Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable
Hi Iain,
Thank you again for your reply.
It's good to know that things works for people almost in my = situation=20 :-).
 
I am not surprise that there is no problem = with Shift-Jis, since=20 "SET client_encoding=3D 'SJIS';" works fine on a EUC_JP database.
 
But "SET client_encoding=3D 'UNICODE';" does not work with 7.1.... = and I=20 feel really stuck because of that...
 
>When you install the = postgres ODBC=20 driver it actually contains 3 drivers, which one are you = using?
I tried the PostgreSQL 8.00. and PostgreSQL Unicode beta but both = of them=20 try to do "SET client_encoding=3D 'UNICODE'"...
 
In my case, I really need to convert the encoding before sending it = to=20 Postgres... but I don't know if it is possible.
 
>So far I've never had to = pay much=20 attention to client encoding...
Lucky man :-)
 
Cheers,
Ben
----- Original Message ----- =
From:=20 Iain =
To: Layet Benjamin ; pgsql-odbc@postgresql.org =
Sent: Monday, February = 07, 2005=20 5:31 PM
Subject: Re: [ODBC] ODBC = &=20 character encoding

Hi Benjamin,
 
I don't have direct = experience of your=20 exact situation, but I use a 7.1 database via ODBC. The difference is = that the=20 client is not unicode, it's plain old windows shift-JIS and that works = fine=20 iff you use the unicode support odbc driver. When you install the = postgres=20 ODBC driver it actually contains 3 drivers, which one are you=20 using?
 
> Can the ODBC driver convert the query string from UTF8 to = EUC_JP=20 before sending it to the database server ?
 
I'm not sure...
 
> Can the ODBC driver take EUC_JP string as input ? = (then I=20 would 'just' have to figure out how to send EUC_JP stings from=20 C#...) 
 
I dunno about that either, = but it=20 certainly accepts shift-JIS which is the native encoding for=20 windows.
 
So far I've never had to pay = much=20 attention to client encoding (with the notable exception of getting = input data=20 from a web application) as the clients and drivers seem to work = everything out=20 by themselves.
 
Regards
Iain
 
 
----- Original Message ----- =
From:=20 Layet Benjamin
Sent: Monday, February = 07, 2005=20 5:06 PM
Subject: Re: [ODBC] = ODBC &=20 character encoding

Hi,
Thank you Iain for your = quick=20 reply.
But unfortunately this did not solve the problem, 7.1 does not = support=20 this conversion neither yet. (7.3 and 7.4 do):
 
SET client_encoding=3D'UNICODE';
ERROR:  Conversion = between=20 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
 
       =20 = C#            = ;            =            =20 = ODBC           &nb= sp;    =20 Postgres=20 = 7.1
Utf8          &n= bsp;      =20 l =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> =20 = l            =    =20 l =3D=3D=3D=3D=3D>l = UTF8->EUC_JP
(possible->Unicode)  =20 l     = UTF8       =20 = l            =    =20 l UTF8  l
______________________l  (or = Unicode)  =20 l________________l      =20 l_______________
 
 
2
       =20 = C#            = ;            =            =20 = ODBC           &nb= sp;    =20 Postgres=20 = 7.1
Utf8          &n= bsp;      =20 l =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D>  l = UTF8->EUC_JP   l=20 =3D=3D=3D=3D=3D>l
(possible->Unicode)   = l    =20 UTF8       =20 = l            =    =20 l EUC_JPl
______________________l  (or Unicode)  =20 l________________l      =20 l_______________
 
 
3

       =20 = C#            = ;            =            =20 = ODBC           &nb= sp;    =20 Postgres=20 = 7.1
UTF8->EUC_JP        &nb= sp;=20 l =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> =20 = l            =    =20 l =3D=3D=3D=3D=3D>l
(possible->Unicode)   = l    =20 EUC_JP     =20 = l            =    =20 l=20 = EUC_JPl
______________________l      &nb= sp;         =20 l________________l      =20 l_______________
 
 
Number 1 seem to be the normal solution, but it does not work = with=20 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=20 EUC_JP before sending it to the database server ?
or
- Can the ODBC driver take EUC_JP string as input ? (then = I would=20 'just' have to figure out how to send EUC_JP stings from = C#...) 
 
Help extremely needed...
Thank you !
 
Benjamin
 
------=_NextPart_000_0030_01C50D46.50A1F3F0--