{
    "mode": "man",
    "parameter": "bind_textdomain_codeset",
    "section": "3",
    "url": "https://www.chedong.com/phpMan.php/man/bind_textdomain_codeset/3/json",
    "generated": "2026-11-08T00:38:48Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "bindtextdomaincodeset - set encoding of message translations\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "#include <libintl.h>",
                    "content": "char * bindtextdomaincodeset (const char * domainname,\nconst char * codeset);\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "The  bindtextdomaincodeset function sets the output codeset for message catalogs for domain\ndomainname.\n\nA message domain is a set of translatable msgid messages. Usually, every software package has\nits own message domain.\n\nBy default, the gettext family of functions returns translated messages in the locale's char‐\nacter encoding, which  can  be  retrieved  as  nllanginfo(CODESET).  The  need  for  calling\nbindtextdomaincodeset  arises  for programs which store strings in a locale independent way\n(e.g.  UTF-8) and want to avoid an extra character set conversion on the returned  translated\nmessages.\n\ndomainname must be a non-empty string.\n\nIf codeset is not NULL, it must be a valid encoding name which can be used for the iconvopen\nfunction.  The  bindtextdomaincodeset function sets the output codeset for message catalogs\nbelonging to domain domainname to codeset. The function makes copies of the argument  strings\nas needed.\n\nIf  codeset  is  NULL, the function returns the previously set codeset for domain domainname.\nThe default is NULL, denoting the locale's character encoding.\n",
            "subsections": []
        },
        "RETURN VALUE": {
            "content": "If successful, the bindtextdomaincodeset function returns the current  codeset  for  domain\ndomainname,  after  possibly  changing  it.  The  resulting  string  is  valid until the next\nbindtextdomaincodeset call for the same domainname and must not be modified or freed. If  a\nmemory allocation failure occurs, it sets errno to ENOMEM and returns NULL. If no codeset has\nbeen set for domain domainname, it returns NULL.\n",
            "subsections": []
        },
        "ERRORS": {
            "content": "The following error can occur, among others:\n\nENOMEM Not enough memory available.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "The return type ought to be const char *, but is char * to avoid warnings in C code predating\nANSI C.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "gettext(3),  dgettext(3),  dcgettext(3),  ngettext(3),  dngettext(3),  dcngettext(3), textdo‐\nmain(3), nllanginfo(3), iconvopen(3)\n\nGNU gettext 0.20.1.124-32cf                   May 2001                    BINDTEXTDOMAINCODESET(3)",
            "subsections": []
        }
    },
    "summary": "bindtextdomaincodeset - set encoding of message translations",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "gettext",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/gettext/3/json"
        },
        {
            "name": "dgettext",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/dgettext/3/json"
        },
        {
            "name": "dcgettext",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/dcgettext/3/json"
        },
        {
            "name": "ngettext",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/ngettext/3/json"
        },
        {
            "name": "dngettext",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/dngettext/3/json"
        },
        {
            "name": "dcngettext",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/dcngettext/3/json"
        },
        {
            "name": "main",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/main/3/json"
        },
        {
            "name": "nllanginfo",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/nllanginfo/3/json"
        },
        {
            "name": "iconvopen",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/iconvopen/3/json"
        }
    ]
}