Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
bind_textdomain_codeset(3)
Edit
PageHistory
Diff
Info
LikePages
BIND_TEXTDOMAIN_CODESET !!!BIND_TEXTDOMAIN_CODESET NAME SYNOPSIS DESCRIPTION RETURN VALUE ERRORS BUGS SEE ALSO ---- !!NAME bind_textdomain_codeset - set encoding of message translations !!SYNOPSIS __#include __ ''domainname''__, const char *__ ''codeset''__); __ !!DESCRIPTION The __bind_textdomain_codeset__ function sets the output codeset for message catalogs for domain ''domainname''. A message domain is a set of translatable ''msgid'' messages. Usually, every software package has its own message domain. By default, the __gettext__ family of functions returns translated messages in the locale's character encoding, which can be retrieved as __nl_langinfo(CODESET)__. The need for calling __bind_textdomain_codeset__ arises for programs which store strings in a locale independent way (e.g. UTF-8) and want to avoid an extra character set conversion on the returned translated messages. ''domainname'' must be a non-empty string. If ''codeset'' is not NULL, it must be a valid encoding name which can be used for the __iconv_open__ function. The __bind_textdomain_codeset__ function sets the output codeset for message catalogs belonging to domain ''domainname'' to ''codeset''. The function makes copies of the argument strings as needed. If ''codeset'' is NULL, the function returns the previously set codeset for domain ''domainname''. The default is NULL, denoting the locale's character encoding. !!RETURN VALUE If successful, the __bind_textdomain_codeset__ function returns the current codeset for domain ''domainname'', after possibly changing it. The resulting string is valid until the next __bind_textdomain_codeset__ call for the same ''domainname'' and must not be modified or freed. If a memory allocation failure occurs, it sets __errno__ to __ENOMEM__ and returns NULL. If no codeset has been set for domain ''domainname'', it returns NULL. !!ERRORS The following error can occur, among others: __ENOMEM__ Not enough memory available. !!BUGS The return type ought to be __const char *__, but is __char *__ to avoid warnings in C code predating ANSI C. !!SEE ALSO gettext(3), dgettext(3), dcgettext(3), ngettext(3), dngettext(3), dcngettext(3), textdomain(3), nl_langinfo(3), __iconv_open__(3) ----
3 pages link to
bind_textdomain_codeset(3)
:
Man3b
textdomain(3)
gettext(3)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.