client encodings

From: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: client encodings
Date: 2003-06-15 09:30:11
Message-ID: Pine.LNX.4.44.0306151037010.6856-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've fixed the problems in psql that was there before:

* psql alters the strings in a PQresult
* psql sends non validating strings to server

This is however not the solution to the general problem with client
encodings. When you normally run psql in a terminal, the encoding used by
that terminal is the only reasonable encoding one can use. However, if you
redirect the output you very well might want to produce a utf-8 file even
if the terminal does not suppert it. So it could be usable to change the
client encoding in psql.

However, if you want to produce a utf-8 file, how should that work with
respect to gettext()? If the message catalog is in latin1 then we need to
know that and convert that into utf-8.

The easiest way as I see it is to demand that all po files are stored in
utf-8 and then you can convert that into whatever client encoding you have
set in psql. Of course you can't make that translation lossfree in
general, but if you have a language that demands some characters that
don't exist in the target charset you have lost anyway. The best you can
do is to convert it to something similar (or even just through it away).

To store all po files as utf-8 is not a big problem. The translator can
very well still work using some other charset and then you use iconv to
convert it before checking it in. As long as you don't change that file
(and use other characters) the translator can later on use iconv again to
get it back to his charset. The good thing about this is that psql knows
what charset all strings are in and can convert when needed.

Would it be acceptable to have all po-files as utf-8?

--
/Dennis

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shridhar Daithankar 2003-06-15 10:43:07 Re: Pre-allocation of shared memory ...
Previous Message Bruce Momjian 2003-06-15 04:07:12 Re: [HACKERS] ECPG, threading and pooling