1 |
perry |
1 |
BIND_TEXTDOMAIN_CODESET |
|
|
2 |
!!!BIND_TEXTDOMAIN_CODESET |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
RETURN VALUE |
|
|
7 |
ERRORS |
|
|
8 |
BUGS |
|
|
9 |
SEE ALSO |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
bind_textdomain_codeset - set encoding of message translations |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__#include |
|
|
19 |
__ ''domainname''__, |
|
|
20 |
const char *__ ''codeset''__); |
|
|
21 |
__ |
|
|
22 |
!!DESCRIPTION |
|
|
23 |
|
|
|
24 |
|
|
|
25 |
The __bind_textdomain_codeset__ function sets the output |
|
|
26 |
codeset for message catalogs for domain |
|
|
27 |
''domainname''. |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
A message domain is a set of translatable ''msgid'' |
|
|
31 |
messages. Usually, every software package has its own |
|
|
32 |
message domain. |
|
|
33 |
|
|
|
34 |
|
|
|
35 |
By default, the __gettext__ family of functions returns |
|
|
36 |
translated messages in the locale's character encoding, |
|
|
37 |
which can be retrieved as __nl_langinfo(CODESET)__. The |
|
|
38 |
need for calling __bind_textdomain_codeset__ arises for |
|
|
39 |
programs which store strings in a locale independent way |
|
|
40 |
(e.g. UTF-8) and want to avoid an extra character set |
|
|
41 |
conversion on the returned translated messages. |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
''domainname'' must be a non-empty string. |
|
|
45 |
|
|
|
46 |
|
|
|
47 |
If ''codeset'' is not NULL, it must be a valid encoding |
|
|
48 |
name which can be used for the __iconv_open__ function. |
|
|
49 |
The __bind_textdomain_codeset__ function sets the output |
|
|
50 |
codeset for message catalogs belonging to domain |
|
|
51 |
''domainname'' to ''codeset''. The function makes |
|
|
52 |
copies of the argument strings as needed. |
|
|
53 |
|
|
|
54 |
|
|
|
55 |
If ''codeset'' is NULL, the function returns the |
|
|
56 |
previously set codeset for domain ''domainname''. The |
|
|
57 |
default is NULL, denoting the locale's character |
|
|
58 |
encoding. |
|
|
59 |
!!RETURN VALUE |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
If successful, the __bind_textdomain_codeset__ function |
|
|
63 |
returns the current codeset for domain ''domainname'', |
|
|
64 |
after possibly changing it. The resulting string is valid |
|
|
65 |
until the next __bind_textdomain_codeset__ call for the |
|
|
66 |
same ''domainname'' and must not be modified or freed. If |
|
|
67 |
a memory allocation failure occurs, it sets __errno__ to |
|
|
68 |
__ENOMEM__ and returns NULL. If no codeset has been set |
|
|
69 |
for domain ''domainname'', it returns NULL. |
|
|
70 |
!!ERRORS |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
The following error can occur, among others: |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
__ENOMEM__ |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
Not enough memory available. |
|
|
80 |
!!BUGS |
|
|
81 |
|
|
|
82 |
|
|
|
83 |
The return type ought to be __const char *__, but is |
|
|
84 |
__char *__ to avoid warnings in C code predating ANSI |
|
|
85 |
C. |
|
|
86 |
!!SEE ALSO |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
gettext(3), dgettext(3), dcgettext(3), |
|
|
90 |
ngettext(3), dngettext(3), |
|
|
91 |
dcngettext(3), textdomain(3), |
4 |
perry |
92 |
nl_langinfo(3), __iconv_open__(3) |
1 |
perry |
93 |
---- |