bind_textdomain_codeset -- specify encoding for message retrieval from message catalog for domain DOMAINNAME


#include <libintl.h>

extern char *bind_textdomain_codeset(const char *domainname, const char *codeset);


The bind_textdomain_codeset function can be used to specify the output codeset for message catalogs for domain domainname. The codeset aregument must be a valid codeset name which can be used tor the iconv_open() funtion, or a null pointer. If the codeset argument is the null pointer, then function returns the currently selected codeset for the domain with the name domainname. It returns null pointer if no codeset has yet been selected

The bind_textdomain_codeset function can be used several times. If used multiple times, with the same domainname argument, the later call overrrides the settings made by the earlier one.

The bind_textdomain_codeset function returns a pointer to a string containing the name of the selected codeset. The string is allocated internally in the function and must not be changed by the user.



The domainname argument is applied to the currenlty active LC_MESSAGE locale. It is equivalent in syntax and meaning to the domainname argument to textdomain(), except that the selection of the domain is valid only for the duration of the call.


Returns the currently selected codeset name. It returns null pointer if no codeset has yet been selected.


The function is not required to set the external errno variable.

See Also

gettext, dgettext, ngettext, dngettext, dcgettext, dcngettext, textdomain, bindtextdomain, bind_textdomain_codeset