Move client encoding libpq function docs into libpq doc section, and
authorBruce Momjian <bruce@momjian.us>
Thu, 6 Mar 2008 15:38:02 +0000 (15:38 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 6 Mar 2008 15:38:02 +0000 (15:38 +0000)
just reference them from the localization doc section.

Backpatch to 8.3.X.

doc/src/sgml/charset.sgml
doc/src/sgml/libpq.sgml

index 40d172d5d9f5bb74042180d60e6df19951fafdfa..e9aca194bc0e68b7aa28c6b939de6154d5fd894b 100644 (file)
@@ -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>
 
index 2d5520564830c4b1d2064b0ff92ccb1c459c7124..fe9f187f3f256582251d32f557906c1cd34a749f 100644 (file)
@@ -4415,6 +4415,56 @@ typedef struct {
   </para>
 
   <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>
     <term>
      <function>PQsetErrorVerbosity</function>