pgsql: Set psql client encoding from locale by default - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Set psql client encoding from locale by default
Date
Msg-id E1PqgpM-00038U-L0@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Set psql client encoding from locale by default

Add a new libpq connection option client_encoding (which includes the
existing PGCLIENTENCODING environment variable), which besides an
encoding name accepts a special value "auto" that tries to determine
the encoding from the locale in the client's environment, using the
mechanisms that have been in use in initdb.

psql sets this new connection option to "auto" when running from a
terminal and not overridden by setting PGCLIENTENCODING.

original code by Heikki Linnakangas, with subsequent contributions by
Jaime Casanova, Peter Eisentraut, Stephen Frost, Ibrar Ahmed

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/02e14562a806a96f38120c96421d39dfa7394192

Modified Files
--------------
doc/src/sgml/libpq.sgml             |   36 ++++++++++++++------
doc/src/sgml/ref/psql-ref.sgml      |   11 ++++++
src/bin/psql/command.c              |    8 +++--
src/bin/psql/startup.c              |    8 +++--
src/interfaces/libpq/.gitignore     |    1 +
src/interfaces/libpq/Makefile       |    6 ++--
src/interfaces/libpq/fe-connect.c   |   24 +++++++++++--
src/interfaces/libpq/fe-protocol2.c |   60 +++++++++++++++++++++++++++++++++++
src/interfaces/libpq/fe-protocol3.c |    3 ++
src/interfaces/libpq/libpq-int.h    |    3 ++
10 files changed, 136 insertions(+), 24 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Create the catalog infrastructure for foreign-data-wrapper handl
Next
From: Bruce Momjian
Date:
Subject: pgsql: Initialize variable to quiet compiler.