Install gettext-0.18.1.1.tar.gz
[msysgit.git] / mingw / share / doc / gettext / bind_textdomain_codeset.3.html
blob7c48fb1528da8c9a49904276a701c0ee8112d5ad
1 <!-- Creator : groff version 1.18.1 -->
2 <html>
3 <head>
4 <meta name="generator" content="groff -Thtml, see www.gnu.org">
5 <meta name="Content-Style" content="text/css">
6 <title>BIND_TEXTDOMAIN_CODESET</title>
7 </head>
8 <body>
10 <h1 align=center>BIND_TEXTDOMAIN_CODESET</h1>
11 <a href="#NAME">NAME</a><br>
12 <a href="#SYNOPSIS">SYNOPSIS</a><br>
13 <a href="#DESCRIPTION">DESCRIPTION</a><br>
14 <a href="#RETURN VALUE">RETURN VALUE</a><br>
15 <a href="#ERRORS">ERRORS</a><br>
16 <a href="#BUGS">BUGS</a><br>
17 <a href="#SEE ALSO">SEE ALSO</a><br>
19 <hr>
20 <a name="NAME"></a>
21 <h2>NAME</h2>
22 <!-- INDENTATION -->
23 <table width="100%" border=0 rules="none" frame="void"
24 cols="2" cellspacing="0" cellpadding="0">
25 <tr valign="top" align="left">
26 <td width="10%"></td>
27 <td width="89%">
28 <p>bind_textdomain_codeset &minus; set encoding of message
29 translations</p>
30 </td>
31 </table>
32 <a name="SYNOPSIS"></a>
33 <h2>SYNOPSIS</h2>
34 <!-- INDENTATION -->
35 <table width="100%" border=0 rules="none" frame="void"
36 cols="2" cellspacing="0" cellpadding="0">
37 <tr valign="top" align="left">
38 <td width="10%"></td>
39 <td width="89%">
40 <pre><b>#include &lt;libintl.h&gt;
42 char * bind_textdomain_codeset (const char *</b> <i>domainname</i><b>,
43 const char *</b> <i>codeset</i><b>);
44 </b></pre>
45 </td>
46 </table>
47 <a name="DESCRIPTION"></a>
48 <h2>DESCRIPTION</h2>
49 <!-- INDENTATION -->
51 <table width="100%" border=0 rules="none" frame="void"
52 cols="2" cellspacing="0" cellpadding="0">
53 <tr valign="top" align="left">
54 <td width="10%"></td>
55 <td width="89%">
56 <p>The <b>bind_textdomain_codeset</b> function sets the
57 output codeset for message catalogs for domain
58 <i>domainname</i>.</p>
59 <!-- INDENTATION -->
60 <p>A message domain is a set of translatable <i>msgid</i>
61 messages. Usually, every software package has its own
62 message domain.</p>
63 <!-- INDENTATION -->
64 <p>By default, the <b>gettext</b> family of functions
65 returns translated messages in the locale&rsquo;s character
66 encoding, which can be retrieved as
67 <b>nl_langinfo(CODESET)</b>. The need for calling
68 <b>bind_textdomain_codeset</b> arises for programs which
69 store strings in a locale independent way (e.g. UTF-8) and
70 want to avoid an extra character set conversion on the
71 returned translated messages.</p>
72 <!-- INDENTATION -->
73 <p><i>domainname</i> must be a non-empty string.</p>
74 <!-- INDENTATION -->
75 <p>If <i>codeset</i> is not NULL, it must be a valid
76 encoding name which can be used for the <b>iconv_open</b>
77 function. The <b>bind_textdomain_codeset</b> function sets
78 the output codeset for message catalogs belonging to domain
79 <i>domainname</i> to <i>codeset</i>. The function makes
80 copies of the argument strings as needed.</p>
81 <!-- INDENTATION -->
82 <p>If <i>codeset</i> is NULL, the function returns the
83 previously set codeset for domain <i>domainname</i>. The
84 default is NULL, denoting the locale&rsquo;s character
85 encoding.</p>
86 </td>
87 </table>
88 <a name="RETURN VALUE"></a>
89 <h2>RETURN VALUE</h2>
90 <!-- INDENTATION -->
91 <table width="100%" border=0 rules="none" frame="void"
92 cols="2" cellspacing="0" cellpadding="0">
93 <tr valign="top" align="left">
94 <td width="10%"></td>
95 <td width="89%">
96 <p>If successful, the <b>bind_textdomain_codeset</b>
97 function returns the current codeset for domain
98 <i>domainname</i>, after possibly changing it. The resulting
99 string is valid until the next
100 <b>bind_textdomain_codeset</b> call for the same
101 <i>domainname</i> and must not be modified or freed. If a
102 memory allocation failure occurs, it sets <b>errno</b> to
103 <b>ENOMEM</b> and returns NULL. If no codeset has been set
104 for domain <i>domainname</i>, it returns NULL.</p>
105 </td>
106 </table>
107 <a name="ERRORS"></a>
108 <h2>ERRORS</h2>
109 <!-- INDENTATION -->
110 <table width="100%" border=0 rules="none" frame="void"
111 cols="2" cellspacing="0" cellpadding="0">
112 <tr valign="top" align="left">
113 <td width="10%"></td>
114 <td width="89%">
115 <p>The following error can occur, among others:</p>
116 </td>
117 </table>
118 <!-- TABS -->
119 <table width="100%" border=0 rules="none" frame="void"
120 cols="5" cellspacing="0" cellpadding="0">
121 <tr valign="top" align="left">
122 <td width="11%"></td>
123 <td width="8%">
125 <p><b>ENOMEM</b></p>
126 </td>
127 <td width="13%"></td>
128 <td width="41%">
130 <p>Not enough memory available.</p>
131 </td>
132 <td width="24%">
133 </td>
134 </table>
135 <a name="BUGS"></a>
136 <h2>BUGS</h2>
137 <!-- INDENTATION -->
138 <table width="100%" border=0 rules="none" frame="void"
139 cols="2" cellspacing="0" cellpadding="0">
140 <tr valign="top" align="left">
141 <td width="10%"></td>
142 <td width="89%">
143 <p>The return type ought to be <b>const char *</b>, but is
144 <b>char *</b> to avoid warnings in C code predating ANSI
145 C.</p>
146 </td>
147 </table>
148 <a name="SEE ALSO"></a>
149 <h2>SEE ALSO</h2>
150 <!-- INDENTATION -->
151 <table width="100%" border=0 rules="none" frame="void"
152 cols="2" cellspacing="0" cellpadding="0">
153 <tr valign="top" align="left">
154 <td width="10%"></td>
155 <td width="89%">
156 <p><b>gettext</b>(3), <b>dgettext</b>(3),
157 <b>dcgettext</b>(3), <b>ngettext</b>(3),
158 <b>dngettext</b>(3), <b>dcngettext</b>(3),
159 <b>textdomain</b>(3), <b>nl_langinfo</b>(3),
160 <b>iconv_open</b>(3)</p>
161 </td>
162 </table>
163 <hr>
164 </body>
165 </html>