Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit51c3727

Browse files
committed
Move client encoding libpq function docs into libpq doc section, and
just reference them from the localization doc section.Backpatch to 8.3.X.
1 parenta4591ab commit51c3727

File tree

2 files changed

+53
-27
lines changed

2 files changed

+53
-27
lines changed

‎doc/src/sgml/charset.sgml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.84 2007/09/28 22:25:49 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.85 2008/03/06 15:37:56 momjian Exp $ -->
22

33
<chapter id="charset">
44
<title>Localization</>
@@ -1110,31 +1110,7 @@ $ <userinput>psql -l</userinput>
11101110

11111111
<listitem>
11121112
<para>
1113-
Using <application>libpq</> functions.
1114-
<command>\encoding</command> actually calls
1115-
<function>PQsetClientEncoding()</function> for its purpose.
1116-
1117-
<synopsis>
1118-
int PQsetClientEncoding(PGconn *<replaceable>conn</replaceable>, const char *<replaceable>encoding</replaceable>);
1119-
</synopsis>
1120-
1121-
where <replaceable>conn</replaceable> is a connection to the server,
1122-
and <replaceable>encoding</replaceable> is the encoding you
1123-
want to use. If the function successfully sets the encoding, it returns 0,
1124-
otherwise -1. The current encoding for this connection can be determined by
1125-
using:
1126-
1127-
<synopsis>
1128-
int PQclientEncoding(const PGconn *<replaceable>conn</replaceable>);
1129-
</synopsis>
1130-
1131-
Note that it returns the encoding ID, not a symbolic string
1132-
such as <literal>EUC_JP</literal>. To convert an encoding ID to an encoding name, you
1133-
can use:
1134-
1135-
<synopsis>
1136-
char *pg_encoding_to_char(int <replaceable>encoding_id</replaceable>);
1137-
</synopsis>
1113+
<application>libpq</> (<xref linkend="libpq-control">) has functions to control the client encoding.
11381114
</para>
11391115
</listitem>
11401116

‎doc/src/sgml/libpq.sgml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.255 2008/01/31 23:31:33 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.256 2008/03/06 15:37:56 momjian Exp $ -->
22

33
<chapter id="libpq">
44
<title><application>libpq</application> - C Library</title>
@@ -4415,6 +4415,56 @@ typedef struct {
44154415
</para>
44164416

44174417
<variablelist>
4418+
<varlistentry>
4419+
<term>
4420+
<function>PQclientEncoding</function>
4421+
<indexterm>
4422+
<primary>PQclientEncoding</primary>
4423+
</indexterm>
4424+
</term>
4425+
4426+
<listitem>
4427+
<para>
4428+
Returns the client encoding.
4429+
<synopsis>
4430+
int PQclientEncoding(const PGconn *<replaceable>conn</replaceable>);
4431+
</synopsis>
4432+
4433+
Note that it returns the encoding ID, not a symbolic string
4434+
such as <literal>EUC_JP</literal>. To convert an encoding ID to an encoding name, you
4435+
can use:
4436+
4437+
<synopsis>
4438+
char *pg_encoding_to_char(int <replaceable>encoding_id</replaceable>);
4439+
</synopsis>
4440+
</para>
4441+
</listitem>
4442+
</varlistentry>
4443+
4444+
<varlistentry>
4445+
<term>
4446+
<function>PQsetClientEncoding</function>
4447+
<indexterm>
4448+
<primary>PQsetClientEncoding</primary>
4449+
</indexterm>
4450+
</term>
4451+
4452+
<listitem>
4453+
<para>
4454+
Sets the client encoding.
4455+
<synopsis>
4456+
int PQsetClientEncoding(PGconn *<replaceable>conn</replaceable>, const char *<replaceable>encoding</replaceable>);
4457+
</synopsis>
4458+
4459+
<replaceable>conn</replaceable> is a connection to the server,
4460+
and <replaceable>encoding</replaceable> is the encoding you want to
4461+
use. If the function successfully sets the encoding, it returns 0,
4462+
otherwise -1. The current encoding for this connection can be
4463+
determined by using <function>PQclientEncoding</>.
4464+
</para>
4465+
</listitem>
4466+
</varlistentry>
4467+
44184468
<varlistentry>
44194469
<term>
44204470
<function>PQsetErrorVerbosity</function>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp