From 51c372790370d0f6927a5956d5a4683f99e11042 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 6 Mar 2008 15:37:56 +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 | 28 ++------------------- doc/src/sgml/libpq.sgml | 52 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 27 deletions(-) diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml index f54201fd26..43d2529a19 100644 --- a/doc/src/sgml/charset.sgml +++ b/doc/src/sgml/charset.sgml @@ -1,4 +1,4 @@ - + Localization</> @@ -1110,31 +1110,7 @@ $ <userinput>psql -l</userinput> <listitem> <para> - Using <application>libpq</> functions. - <command>\encoding</command> actually calls - <function>PQsetClientEncoding()</function> for its purpose. - -<synopsis> -int PQsetClientEncoding(PGconn *<replaceable>conn</replaceable>, const char *<replaceable>encoding</replaceable>); -</synopsis> - - where <replaceable>conn</replaceable> is a connection to the server, - and <replaceable>encoding</replaceable> 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: - -<synopsis> -int PQclientEncoding(const PGconn *<replaceable>conn</replaceable>); -</synopsis> - - Note that it returns the encoding ID, not a symbolic string - such as <literal>EUC_JP</literal>. To convert an encoding ID to an encoding name, you - can use: - -<synopsis> -char *pg_encoding_to_char(int <replaceable>encoding_id</replaceable>); -</synopsis> + <application>libpq</> (<xref linkend="libpq-control">) has functions to control the client encoding. </para> </listitem> diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 25b23dcd20..9e63c91641 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.255 2008/01/31 23:31:33 momjian Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.256 2008/03/06 15:37:56 momjian Exp $ --> <chapter id="libpq"> <title><application>libpq</application> - C Library @@ -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.40.0