mirror of
https://github.com/postgres/postgres.git
synced 2025-07-26 01:22:12 +03:00
Move client encoding libpq function docs into libpq doc section, and
just reference them from the localization doc section. Backpatch to 8.3.X.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.84 2007/09/28 22:25:49 tgl Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.85 2008/03/06 15:37:56 momjian Exp $ -->
|
||||||
|
|
||||||
<chapter id="charset">
|
<chapter id="charset">
|
||||||
<title>Localization</>
|
<title>Localization</>
|
||||||
@ -1110,31 +1110,7 @@ $ <userinput>psql -l</userinput>
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Using <application>libpq</> functions.
|
<application>libpq</> (<xref linkend="libpq-control">) has functions to control the client encoding.
|
||||||
<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>
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
@ -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">
|
<chapter id="libpq">
|
||||||
<title><application>libpq</application> - C Library</title>
|
<title><application>libpq</application> - C Library</title>
|
||||||
@ -4415,6 +4415,56 @@ typedef struct {
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<function>PQclientEncoding</function>
|
||||||
|
<indexterm>
|
||||||
|
<primary>PQclientEncoding</primary>
|
||||||
|
</indexterm>
|
||||||
|
</term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Returns the client encoding.
|
||||||
|
<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>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<function>PQsetClientEncoding</function>
|
||||||
|
<indexterm>
|
||||||
|
<primary>PQsetClientEncoding</primary>
|
||||||
|
</indexterm>
|
||||||
|
</term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Sets the client encoding.
|
||||||
|
<synopsis>
|
||||||
|
int PQsetClientEncoding(PGconn *<replaceable>conn</replaceable>, const char *<replaceable>encoding</replaceable>);
|
||||||
|
</synopsis>
|
||||||
|
|
||||||
|
<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 <function>PQclientEncoding</>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<function>PQsetErrorVerbosity</function>
|
<function>PQsetErrorVerbosity</function>
|
||||||
|
Reference in New Issue
Block a user