pgaccess and multibyte-enabled libpq - Mailing list pgsql-interfaces

From Oliver Elphick
Subject pgaccess and multibyte-enabled libpq
Date
Msg-id 200002162300.XAA21280@linda.lfix.co.uk
Whole thread Raw
List pgsql-interfaces
I sent this report to Constantin Teodorescu, as author of pgaccess,
but it now occurs to me that it is probably something to be handled
in libpgtcl instead.

---------------------------------------------------------------------
I have had a bug-report on pgaccess (from PostgreSQL 6.5.3) when used
with multi-byte encoding and with Tcl 8.2.

Your website says that Tcl/Tk 8.0 or higher is needed.
However, there are problems with multibyte-encoding with Tcl8.2 and 
I don't see any reference to this in "What's New".

At 8.1, Tcl introduced internationalisation.  Everything is reduced
to Unicode internally.  If someone uses pgaccess with (say) KOI-8 as
the default encoding for the whole machine, and with a database that
uses KOI-8 encoding, Tcl translates KOI-8 user input to Unicode before
using the data.  It then sends the data to the backend in UNICODE, but
does not tell the backend that this is what is happening.  

The user may have PGCLIENTENCODING set to KOI8, or may be depending on
his default environment, but Tcl is doing its own thing.

I think that pgaccess needs to translate back to the native encoding
before it sends data to the backend; it also needs to translate data
from the backend to Unicode before using or displaying it.
---------------------------------------------------------------------

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver              PGP key from public servers; key
ID32B8FAA1                ========================================    "But as many as received him, to them gave he
powerto      become the sons of God, even to them that believe on      his name"        John 1:12 
 




pgsql-interfaces by date:

Previous
From: "Bryan White"
Date:
Subject: Managing the memory requierments of large query results
Next
From: Tom Lane
Date:
Subject: Re: [INTERFACES] Managing the memory requierments of large query results