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 224495457F for ; Mon, 25 Apr 2005 06:07:58 -0300 (ADT) 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 35569-08 for ; Mon, 25 Apr 2005 09:07:47 +0000 (GMT) Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2C236538C8 for ; Mon, 25 Apr 2005 06:07:46 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 3EFA230E89; Mon, 25 Apr 2005 11:06:25 +0200 (MET DST) From: "Ben Trewern" X-Newsgroups: pgsql.interfaces.odbc Subject: Re: Another post 7.3.02 bug Was: ODBC and encodings problem Date: Mon, 25 Apr 2005 10:07:41 +0100 Organization: Hub.Org Networking Services Lines: 203 Message-ID: References: <6C0CF58A187DA5479245E0830AF84F42143227@poweredge.attiksystem.ch> <4269ED02.80503@kolumbus.fi> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 To: pgsql-odbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.185 tagged_above=0 required=5 tests=PRIORITY_NO_NAME X-Spam-Level: * X-Archive-Number: 200504/134 X-Sequence-Number: 5293 Thanks for your reply, This is approximately how I understood it. I still do see a problem: Using SQL_ASCII character set on the server. - Connecting with ZeosDbo and Delphi I get the correct representation of £ signs. - Connecting with pgAdmin III (via libpq) I get the same. - Connecting with pgODBC version 7.03.0208 or before I get the same. - When I connect with the latest pgODBC version (08.00.0003) I get the results as stated previously. As I understand it, the ODBC driver shouldn't try to decode data from the server in this situation, but it must do, as when I look into the mylog file the data returned from the database is correct. Ben "Marko Ristola" wrote in message news:4269ED02.80503@kolumbus.fi... > > I checked the ODBC 8.x CVS HEAD (source code). I found out, that it seems > to work nicely > on Windows. I don't know anything about Linux ODBC driver side. > > If the backend uses SQL_ASCII charset, it means, that the backend > does not know the charset of the non ASCII characters. > Pound character does not belong to those characters. > > Correct way of fixing the bug is to tell for the backend server, that what > charset is > used there. LATIN1 or UTF-8 are good alternatives. > > So, if switching into LATIN1 as the backend charset works nicely, the ODBC > driver > is okay: according to Philippe Lang, the charset switching works! > > So the user must do an initdb. > > It is very good, that the current ODBC driver handles data conversions > on the client side in Windows. > > I found out this from the source code of CVS HEAD: > > The ODBC driver uses ANSI C API for client charset. So ANSI C charset > selection > (a C standard) works on Windows applications. This means, that C and C++ > programs > do work. Other languages should work also. > > With Windows applications, if an application uses different charsets in > different threads, > the "global" charset selection applies, not one thread's private charset > selection. > > Regards, > Marko Ristola > > Ben Trewern wrote: > >>Does anyone have enough knowledge of the pgODBC driver to see where this >>bug is coming from? I've been looking through the code but can't get a >>handle on how it is structured. Are there any documents available which >>could give me a starting point on kacking the driver. I'm not a C coder >>so this is all a learning experience. >> >>Ben >> >>"Ben Trewern" wrote in message >>news:d3ohub$och$1@news.hub.org... >> >>>I've looked at the mylog outputs from pgODBC in this case and they seem >>>to show the driver (at some point) returns the correct values. How these >>>are then translated and shown in MS Access is beyond me. I'll keep >>>investigating though. >>> >>>[investigated some more]I just tried pgODBC 7.03.0208 and I get the >>>correct result. Seems it's another bug that's been introduced after this >>>time. I'll look to see which version is the earliest to cause this >>>problem. >>> >>>Ben >>> >>>""Philippe Lang"" wrote in message >>>news:6C0CF58A187DA5479245E0830AF84F42143227@poweredge.attiksystem.ch... >>> >>>>There is a project of an ODBC driver that uses libpq at Command >>>>Prompt... >>>> >>>>This is an answer I got a few weeks ago. >>>> >>>> >>>>>Our driver is sorely outdated. We are currently working on a brand new >>>>>(as in from scratcH) open source driver sourced from libpq. >>>>> >>>>>Sincerely, >>>>> >>>>>Joshua D. Drake >>>>>Command Prompt, Inc. >>>>> >>>>We are all looking forward to trying it. But licencing and deadlines are >>>>not really clear at the moment. >>>> >>>>Philippe >>>> >>>> >>>>-----Message d'origine----- >>>>De : pgsql-odbc-owner@postgresql.org >>>>[mailto:pgsql-odbc-owner@postgresql.org] De la part de Ben Trewern >>>>Envoyé : vendredi, 15. avril 2005 13:15 >>>>À : pgsql-odbc@postgresql.org >>>>Objet : Re: [ODBC] ODBC and encodings problem >>>> >>>>Does this mean I have to initdb my cluster again? I tried to do this on >>>>windows with 'initdb --encoding=LATIN1' but it hang on 'selecting >>>>default max_connections ...' I'm looking into this now. Not sure if >>>>it's an encoding problem or something else. >>>> >>>>What I was wondering was, why does the ODBC driver act differently to >>>>Zeos or pgAdmin III? Zeos and pgAdmin both use the libpq client library >>>>which I suppose is the standard. Is there a way the ODBC driver could >>>>be hacked to give the same response as libpq or am I simplifying this >>>>too much. >>>> >>>>Ben >>>> >>>>""Philippe Lang"" wrote in message >>>>news:6C0CF58A187DA5479245E0830AF84F4214321E@poweredge.attiksystem.ch... >>>> >>>>>Hi, >>>>> >>>>>I don't know exactly which encoding you need, but at least for french, >>>>>encoding a datatabase in LATIN1 solves the problem... >>>>> >>>>>Bye >>>>> >>>>>Philippe >>>>> >>>>>-----Message d'origine----- >>>>>De : pgsql-odbc-owner@postgresql.org >>>>>[mailto:pgsql-odbc-owner@postgresql.org] De la part de Ben Trewern >>>>>Envoyé : jeudi, 14. avril 2005 21:20 À : pgsql-odbc@postgresql.org >>>>>Objet : [ODBC] ODBC and encodings problem >>>>> >>>>>Hi all, >>>>> >>>>>Using PostgreSQL 8.0.1 on Linux >>>>> >>>>>I've got a database with an encoding of SQL_ASCII. I've accessed it >>>>>with pgAdmin III and Delphi through ZeosDBO and had no problems. Now >>>>>I've been using MS Access XP with pgODBC version 8.00.0101 to connect >>>>>to it with some success till now. I've noticed that any field with a >>>>>£ sign in it is not displaying correctly, I get 'WO ô,658.06' instead >>>>>of 'WO £4,658.06' >>>>>and 'WO ÷60.56' instead of 'WO £128.88' etc. I assume it's something >>>>>to do with the encodings used server side or client side. >>>>> >>>>>Any ideas how to fix this? >>>>> >>>>>Regards, >>>>> >>>>>Ben >>>>> >>>>> >>>>> >>>>>---------------------------(end of >>>>>broadcast)--------------------------- >>>>>TIP 8: explain analyze is your friend >>>>> >>>>> >>>>> >>>>>---------------------------(end of >>>>>broadcast)--------------------------- >>>>>TIP 5: Have you checked our extensive FAQ? >>>>> >>>>> http://www.postgresql.org/docs/faq >>>>> >>>>> >>>> >>>>---------------------------(end of broadcast)--------------------------- >>>>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >>>> >>>> >>>> >>>>---------------------------(end of broadcast)--------------------------- >>>>TIP 4: Don't 'kill -9' the postmaster >>>> >>>> >>> >> >> >> >>---------------------------(end of broadcast)--------------------------- >>TIP 4: Don't 'kill -9' the postmaster >> > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >