From fcfd198eba740fc211c00bdab4208a86f5702733 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 6 Mar 2008 15:38:02 +0000 Subject: [PATCH] Move client encoding libpq function docs into libpq doc section, and just reference them from the localization doc section. Backpatch to 8.3.X. --- doc/src/sgml/charset.sgml | 26 +------------------- doc/src/sgml/libpq.sgml | 50 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 25 deletions(-) diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml index 40d172d5d9..e9aca194bc 100644 --- a/doc/src/sgml/charset.sgml +++ b/doc/src/sgml/charset.sgml @@ -1110,31 +1110,7 @@ $ psql -l - Using libpq functions. - \encoding actually calls - PQsetClientEncoding() for its purpose. - - -int PQsetClientEncoding(PGconn *conn, const char *encoding); - - - where conn is a connection to the server, - and encoding is the encoding you - want to use. If the function successfully sets the encoding, it returns 0, - otherwise -1. The current encoding for this connection can be determined by - using: - - -int PQclientEncoding(const PGconn *conn); - - - Note that it returns the encoding ID, not a symbolic string - such as EUC_JP. To convert an encoding ID to an encoding name, you - can use: - - -char *pg_encoding_to_char(int encoding_id); - + libpq () has functions to control the client encoding. diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 2d55205648..fe9f187f3f 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -4415,6 +4415,56 @@ typedef struct { + + + PQclientEncoding + + PQclientEncoding + + + + + + Returns the client encoding. + + int PQclientEncoding(const PGconn *conn); + + + Note that it returns the encoding ID, not a symbolic string + such as EUC_JP. To convert an encoding ID to an encoding name, you + can use: + + +char *pg_encoding_to_char(int encoding_id); + + + + + + + + PQsetClientEncoding + + PQsetClientEncoding + + + + + + Sets the client encoding. + + int PQsetClientEncoding(PGconn *conn, const char *encoding); + + + conn is a connection to the server, + and encoding is the encoding you want to + use. If the function successfully sets the encoding, it returns 0, + otherwise -1. The current encoding for this connection can be + determined by using PQclientEncoding. + + + + PQsetErrorVerbosity -- 2.39.5