1*36dcc4a4SLionel Sambuc.\" $NetBSD: gettext.3,v 1.12 2009/11/12 00:43:52 joerg Exp $ 2*36dcc4a4SLionel Sambuc.\" 3*36dcc4a4SLionel Sambuc.\" Copyright (c) 2000 Citrus Project, 4*36dcc4a4SLionel Sambuc.\" All rights reserved. 5*36dcc4a4SLionel Sambuc.\" 6*36dcc4a4SLionel Sambuc.\" Redistribution and use in source and binary forms, with or without 7*36dcc4a4SLionel Sambuc.\" modification, are permitted provided that the following conditions 8*36dcc4a4SLionel Sambuc.\" are met: 9*36dcc4a4SLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright 10*36dcc4a4SLionel Sambuc.\" notice, this list of conditions and the following disclaimer. 11*36dcc4a4SLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright 12*36dcc4a4SLionel Sambuc.\" notice, this list of conditions and the following disclaimer in the 13*36dcc4a4SLionel Sambuc.\" documentation and/or other materials provided with the distribution. 14*36dcc4a4SLionel Sambuc.\" 15*36dcc4a4SLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16*36dcc4a4SLionel Sambuc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17*36dcc4a4SLionel Sambuc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18*36dcc4a4SLionel Sambuc.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19*36dcc4a4SLionel Sambuc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20*36dcc4a4SLionel Sambuc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21*36dcc4a4SLionel Sambuc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22*36dcc4a4SLionel Sambuc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23*36dcc4a4SLionel Sambuc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24*36dcc4a4SLionel Sambuc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25*36dcc4a4SLionel Sambuc.\" SUCH DAMAGE. 26*36dcc4a4SLionel Sambuc.\" 27*36dcc4a4SLionel Sambuc.Dd November 10, 2004 28*36dcc4a4SLionel Sambuc.Dt GETTEXT 3 29*36dcc4a4SLionel Sambuc.Os 30*36dcc4a4SLionel Sambuc.Sh NAME 31*36dcc4a4SLionel Sambuc.Nm gettext , 32*36dcc4a4SLionel Sambuc.Nm dgettext , 33*36dcc4a4SLionel Sambuc.Nm ngettext , 34*36dcc4a4SLionel Sambuc.Nm dngettext , 35*36dcc4a4SLionel Sambuc.Nm textdomain , 36*36dcc4a4SLionel Sambuc.Nm bindtextdomain , 37*36dcc4a4SLionel Sambuc.Nm bind_textdomain_codeset , 38*36dcc4a4SLionel Sambuc.Nm dcgettext , 39*36dcc4a4SLionel Sambuc.Nm dcngettext 40*36dcc4a4SLionel Sambuc.Nd message handling functions 41*36dcc4a4SLionel Sambuc.Sh LIBRARY 42*36dcc4a4SLionel Sambuc.Lb libintl 43*36dcc4a4SLionel Sambuc.Sh SYNOPSIS 44*36dcc4a4SLionel Sambuc.In libintl.h 45*36dcc4a4SLionel Sambuc.Ft char * 46*36dcc4a4SLionel Sambuc.Fn gettext "const char *msgid" 47*36dcc4a4SLionel Sambuc.Ft char * 48*36dcc4a4SLionel Sambuc.Fn dgettext "const char *domainname" "const char *msgid" 49*36dcc4a4SLionel Sambuc.Ft char * 50*36dcc4a4SLionel Sambuc.Fn ngettext "const char *msgid1" "const char *msgid2" "unsigned long int n" 51*36dcc4a4SLionel Sambuc.Ft char * 52*36dcc4a4SLionel Sambuc.Fn dngettext "const char *domainname" "const char *msgid1" "const char *msgid2" "unsigned long int n" 53*36dcc4a4SLionel Sambuc.Ft char * 54*36dcc4a4SLionel Sambuc.Fn textdomain "const char *domainname" 55*36dcc4a4SLionel Sambuc.Ft char * 56*36dcc4a4SLionel Sambuc.Fn bindtextdomain "const char *domainname" "const char *dirname" 57*36dcc4a4SLionel Sambuc.Ft char * 58*36dcc4a4SLionel Sambuc.Fn bind_textdomain_codeset "const char *domainname" "const char *codeset" 59*36dcc4a4SLionel Sambuc.In libintl.h 60*36dcc4a4SLionel Sambuc.In locale.h 61*36dcc4a4SLionel Sambuc.Ft char * 62*36dcc4a4SLionel Sambuc.Fn dcgettext "const char *domainname" "const char *msgid" "int category" 63*36dcc4a4SLionel Sambuc.Ft char * 64*36dcc4a4SLionel Sambuc.Fn dcngettext "const char *domainname" "const char *msgid1" "const char *msgid2" "unsigned long int n" "int category" 65*36dcc4a4SLionel Sambuc.Sh DESCRIPTION 66*36dcc4a4SLionel SambucThe 67*36dcc4a4SLionel Sambuc.Fn gettext , 68*36dcc4a4SLionel Sambuc.Fn dgettext , 69*36dcc4a4SLionel Sambucand 70*36dcc4a4SLionel Sambuc.Fn dcgettext 71*36dcc4a4SLionel Sambucfunctions attempt to retrieve a 72*36dcc4a4SLionel Sambuctarget string based on the specified 73*36dcc4a4SLionel Sambuc.Fa msgid 74*36dcc4a4SLionel Sambucargument within the context of a 75*36dcc4a4SLionel Sambucspecific domain and the current locale. 76*36dcc4a4SLionel SambucThe length of strings returned by 77*36dcc4a4SLionel Sambuc.Fn gettext , 78*36dcc4a4SLionel Sambuc.Fn dgettext , 79*36dcc4a4SLionel Sambucand 80*36dcc4a4SLionel Sambuc.Fn dcgettext 81*36dcc4a4SLionel Sambucis undetermined until the function is 82*36dcc4a4SLionel Sambuccalled. 83*36dcc4a4SLionel SambucThe 84*36dcc4a4SLionel Sambuc.Fa msgid 85*36dcc4a4SLionel Sambucargument is a nul-terminated string. 86*36dcc4a4SLionel Sambuc.Pp 87*36dcc4a4SLionel SambucThe 88*36dcc4a4SLionel Sambuc.Fn ngettext , 89*36dcc4a4SLionel Sambuc.Fn dngettext , 90*36dcc4a4SLionel Sambucand 91*36dcc4a4SLionel Sambuc.Fn dcngettext 92*36dcc4a4SLionel Sambucfunctions are equivalent to 93*36dcc4a4SLionel Sambuc.Fn gettext , 94*36dcc4a4SLionel Sambuc.Fn dgettext , 95*36dcc4a4SLionel Sambucand 96*36dcc4a4SLionel Sambuc.Fn dcgettext , 97*36dcc4a4SLionel Sambucrespectively, except for the handling of 98*36dcc4a4SLionel Sambucplural forms. 99*36dcc4a4SLionel SambucThe 100*36dcc4a4SLionel Sambuc.Fn ngettext , 101*36dcc4a4SLionel Sambuc.Fn dngettext , 102*36dcc4a4SLionel Sambucand 103*36dcc4a4SLionel Sambuc.Fn dcngettext 104*36dcc4a4SLionel Sambucfunctions search for the 105*36dcc4a4SLionel Sambucmessage string using the 106*36dcc4a4SLionel Sambuc.Fa msgid1 107*36dcc4a4SLionel Sambucargument as the key, using the argument 108*36dcc4a4SLionel Sambuc.Fa n 109*36dcc4a4SLionel Sambucto 110*36dcc4a4SLionel Sambucdetermine the plural form. 111*36dcc4a4SLionel SambucIf no message catalogs are found, 112*36dcc4a4SLionel Sambuc.Fa msgid1 113*36dcc4a4SLionel Sambucis returned 114*36dcc4a4SLionel Sambucif 115*36dcc4a4SLionel Sambuc.Fa n Li == 1 , 116*36dcc4a4SLionel Sambucotherwise 117*36dcc4a4SLionel Sambuc.Fa msgid2 118*36dcc4a4SLionel Sambucis returned. 119*36dcc4a4SLionel Sambuc.Pp 120*36dcc4a4SLionel SambucThe 121*36dcc4a4SLionel Sambuc.Dv LANGUAGE 122*36dcc4a4SLionel Sambucenvironment variable is examined first to determine the message 123*36dcc4a4SLionel Sambuccatalogs to be used. 124*36dcc4a4SLionel SambucThe value of the 125*36dcc4a4SLionel Sambuc.Dv LANGUAGE 126*36dcc4a4SLionel Sambucenvironment variable is a list 127*36dcc4a4SLionel Sambucof locale names separated by colon (:) character. 128*36dcc4a4SLionel SambucIf the 129*36dcc4a4SLionel Sambuc.Dv LANGUAGE 130*36dcc4a4SLionel Sambucenvironment 131*36dcc4a4SLionel Sambucvariable is defined, each locale name is tried in the specified order and if a 132*36dcc4a4SLionel Sambucmessage catalog containing the requested message is found, the message is 133*36dcc4a4SLionel Sambucreturned. 134*36dcc4a4SLionel SambucIf the 135*36dcc4a4SLionel Sambuc.Dv LANGUAGE 136*36dcc4a4SLionel Sambucenvironment variable is defined but failed to locate 137*36dcc4a4SLionel Sambuca message catalog, the 138*36dcc4a4SLionel Sambuc.Fa msgid 139*36dcc4a4SLionel Sambucstring will be returned. 140*36dcc4a4SLionel Sambuc.Pp 141*36dcc4a4SLionel SambucIf the 142*36dcc4a4SLionel Sambuc.Dv LANGUAGE 143*36dcc4a4SLionel Sambucenvironment variable is not defined, 144*36dcc4a4SLionel Sambuc.Dv LC_ALL , 145*36dcc4a4SLionel Sambuc.Dv LC_xxx , 146*36dcc4a4SLionel Sambucand 147*36dcc4a4SLionel Sambuc.Dv LANG 148*36dcc4a4SLionel Sambucenvironment variables are examined to locate the message catalog, 149*36dcc4a4SLionel Sambucfollowing the convention used by the 150*36dcc4a4SLionel Sambuc.Xr setlocale 3 151*36dcc4a4SLionel Sambucfunction. 152*36dcc4a4SLionel Sambuc.Pp 153*36dcc4a4SLionel SambucThe pathname used to locate the message catalog is 154*36dcc4a4SLionel Sambuc.Pa dirname/locale/category/domainname.mo , 155*36dcc4a4SLionel Sambucwhere dirname is the directory specified by 156*36dcc4a4SLionel Sambuc.Fn bindtextdomain , 157*36dcc4a4SLionel Sambuclocale is a locale name determined by the definition of environment variables, 158*36dcc4a4SLionel Sambuc.Fa category 159*36dcc4a4SLionel Sambucis 160*36dcc4a4SLionel Sambuc.Dv LC_MESSAGES 161*36dcc4a4SLionel Sambucif 162*36dcc4a4SLionel Sambuc.Fn gettext , 163*36dcc4a4SLionel Sambuc.Fn ngettext , 164*36dcc4a4SLionel Sambuc.Fn dgettext , 165*36dcc4a4SLionel Sambucor 166*36dcc4a4SLionel Sambuc.Fn dngettext 167*36dcc4a4SLionel Sambucis 168*36dcc4a4SLionel Sambuccalled, otherwise 169*36dcc4a4SLionel Sambuc.Dv LC_xxx 170*36dcc4a4SLionel Sambucwhere the name is the same as the locale category name 171*36dcc4a4SLionel Sambucspecified by the 172*36dcc4a4SLionel Sambuc.Fa category 173*36dcc4a4SLionel Sambucargument of 174*36dcc4a4SLionel Sambuc.Fn dcgettext 175*36dcc4a4SLionel Sambucor 176*36dcc4a4SLionel Sambuc.Fn dcngettext . 177*36dcc4a4SLionel Sambuc.Fa domainname 178*36dcc4a4SLionel Sambucis the name of the domain specified by 179*36dcc4a4SLionel Sambuc.Fn textdomain 180*36dcc4a4SLionel Sambucor the 181*36dcc4a4SLionel Sambuc.Fa domainname 182*36dcc4a4SLionel Sambucargument of 183*36dcc4a4SLionel Sambuc.Fn dgettext , 184*36dcc4a4SLionel Sambuc.Fn dngettext , 185*36dcc4a4SLionel Sambuc.Fn dcgettext , 186*36dcc4a4SLionel Sambucor 187*36dcc4a4SLionel Sambuc.Fn dcngettext . 188*36dcc4a4SLionel Sambuc.Pp 189*36dcc4a4SLionel SambucFor 190*36dcc4a4SLionel Sambuc.Fn gettext 191*36dcc4a4SLionel Sambucand 192*36dcc4a4SLionel Sambuc.Fn ngettext , 193*36dcc4a4SLionel Sambucthe domain used is set by the last valid call to 194*36dcc4a4SLionel Sambuc.Fn textdomain . 195*36dcc4a4SLionel SambucIf a valid call to 196*36dcc4a4SLionel Sambuc.Fn textdomain 197*36dcc4a4SLionel Sambuchas not been made, the default 198*36dcc4a4SLionel Sambucdomain (called messages) is used. 199*36dcc4a4SLionel Sambuc.Pp 200*36dcc4a4SLionel SambucFor 201*36dcc4a4SLionel Sambuc.Fn dgettext , 202*36dcc4a4SLionel Sambuc.Fn dngettext , 203*36dcc4a4SLionel Sambuc.Fn dcgettext , 204*36dcc4a4SLionel Sambucand 205*36dcc4a4SLionel Sambuc.Fn dcngettext , 206*36dcc4a4SLionel Sambucthe domain used is 207*36dcc4a4SLionel Sambucspecified by the 208*36dcc4a4SLionel Sambuc.Fa domainname 209*36dcc4a4SLionel Sambucargument. 210*36dcc4a4SLionel SambucThe 211*36dcc4a4SLionel Sambuc.Fa domainname 212*36dcc4a4SLionel Sambucargument is equivalent in 213*36dcc4a4SLionel Sambucsyntax and meaning to the 214*36dcc4a4SLionel Sambuc.Fa domainname 215*36dcc4a4SLionel Sambucargument to 216*36dcc4a4SLionel Sambuc.Fn textdomain , 217*36dcc4a4SLionel Sambucexcept that the 218*36dcc4a4SLionel Sambucselection of the domain is valid only for the duration of the 219*36dcc4a4SLionel Sambuc.Fn dgettext , 220*36dcc4a4SLionel Sambuc.Fn dngettext , 221*36dcc4a4SLionel Sambuc.Fn dcgettext , 222*36dcc4a4SLionel Sambucor 223*36dcc4a4SLionel Sambuc.Fn dcngettext 224*36dcc4a4SLionel Sambucfunction call. 225*36dcc4a4SLionel Sambuc.Pp 226*36dcc4a4SLionel SambucThe 227*36dcc4a4SLionel Sambuc.Fn dcgettext 228*36dcc4a4SLionel Sambucand 229*36dcc4a4SLionel Sambuc.Fn dcngettext 230*36dcc4a4SLionel Sambucfunctions require additional argument 231*36dcc4a4SLionel Sambuc.Fa category 232*36dcc4a4SLionel Sambucfor retrieving message string for other than 233*36dcc4a4SLionel Sambuc.Dv LC_MESSAGES 234*36dcc4a4SLionel Sambuccategory. 235*36dcc4a4SLionel SambucAvailable value for the 236*36dcc4a4SLionel Sambuc.Fa category 237*36dcc4a4SLionel Sambucargument are 238*36dcc4a4SLionel Sambuc.Dv LC_CTYPE , 239*36dcc4a4SLionel Sambuc.Dv LC_COLLATE , 240*36dcc4a4SLionel Sambuc.Dv LC_MESSAGES , 241*36dcc4a4SLionel Sambuc.Dv LC_MONETARY , 242*36dcc4a4SLionel Sambuc.Dv LC_NUMERIC , 243*36dcc4a4SLionel Sambucand 244*36dcc4a4SLionel Sambuc.Dv LC_TIME . 245*36dcc4a4SLionel SambucThe call of 246*36dcc4a4SLionel Sambuc.Fn dcgettext "domainname" "msgid" "LC_MESSAGES" 247*36dcc4a4SLionel Sambucis equivalent to 248*36dcc4a4SLionel Sambuc.Fn dgettext "domainname" "msgid" . 249*36dcc4a4SLionel SambucNote that 250*36dcc4a4SLionel Sambuc.Dv LC_ALL 251*36dcc4a4SLionel Sambucmust not be used. 252*36dcc4a4SLionel Sambuc.Pp 253*36dcc4a4SLionel SambucThe 254*36dcc4a4SLionel Sambuc.Fn textdomain 255*36dcc4a4SLionel Sambucfunction sets or queries the name of the current domain of the 256*36dcc4a4SLionel Sambucactive 257*36dcc4a4SLionel Sambuc.Dv LC_MESSAGES 258*36dcc4a4SLionel Sambuclocale category. 259*36dcc4a4SLionel SambucThe 260*36dcc4a4SLionel Sambuc.Fa domainname 261*36dcc4a4SLionel Sambucargument is a 262*36dcc4a4SLionel Sambucnul-terminated string that can contain only the characters allowed in legal 263*36dcc4a4SLionel Sambucfilenames. 264*36dcc4a4SLionel Sambuc.Pp 265*36dcc4a4SLionel SambucThe 266*36dcc4a4SLionel Sambuc.Fa domainname 267*36dcc4a4SLionel Sambucargument is the unique name of a domain on the system. 268*36dcc4a4SLionel SambucIf there 269*36dcc4a4SLionel Sambucare multiple versions of the same domain on one system, namespace collisions 270*36dcc4a4SLionel Sambuccan be avoided by using 271*36dcc4a4SLionel Sambuc.Fn bindtextdomain . 272*36dcc4a4SLionel SambucIf 273*36dcc4a4SLionel Sambuc.Fn textdomain 274*36dcc4a4SLionel Sambucis not called, a 275*36dcc4a4SLionel Sambucdefault domain is selected. 276*36dcc4a4SLionel SambucThe setting of domain made by the last valid call 277*36dcc4a4SLionel Sambucto 278*36dcc4a4SLionel Sambuc.Fn textdomain 279*36dcc4a4SLionel Sambucremains valid across subsequent calls to 280*36dcc4a4SLionel Sambuc.Xr setlocale 3 , 281*36dcc4a4SLionel Sambucand 282*36dcc4a4SLionel Sambuc.Fn gettext . 283*36dcc4a4SLionel Sambuc.Pp 284*36dcc4a4SLionel SambucThe 285*36dcc4a4SLionel Sambuc.Fa domainname 286*36dcc4a4SLionel Sambucargument is applied to the currently active LC_MESSAGES locale. 287*36dcc4a4SLionel Sambuc.Pp 288*36dcc4a4SLionel SambucThe current setting of the domain can be queried without affecting the current 289*36dcc4a4SLionel Sambucstate of the domain by calling 290*36dcc4a4SLionel Sambuc.Fn textdomain 291*36dcc4a4SLionel Sambucwith 292*36dcc4a4SLionel Sambuc.Fa domainname 293*36dcc4a4SLionel Sambucset to the 294*36dcc4a4SLionel Sambuc.Dv NULL 295*36dcc4a4SLionel Sambucpointer. 296*36dcc4a4SLionel SambucCalling 297*36dcc4a4SLionel Sambuc.Fn textdomain 298*36dcc4a4SLionel Sambucwith a 299*36dcc4a4SLionel Sambuc.Fa domainname 300*36dcc4a4SLionel Sambucargument of a 301*36dcc4a4SLionel Sambuc.Dv NULL 302*36dcc4a4SLionel Sambucstring sets 303*36dcc4a4SLionel Sambucthe domain to the default domain 304*36dcc4a4SLionel Sambuc.Pq messages . 305*36dcc4a4SLionel Sambuc.Pp 306*36dcc4a4SLionel SambucThe 307*36dcc4a4SLionel Sambuc.Fn bindtextdomain 308*36dcc4a4SLionel Sambucfunction binds the path predicate for a message domain 309*36dcc4a4SLionel Sambuc.Fa domainname 310*36dcc4a4SLionel Sambucto the value contained in dirname. 311*36dcc4a4SLionel SambucIf 312*36dcc4a4SLionel Sambuc.Fa domainname 313*36dcc4a4SLionel Sambucis a non-empty 314*36dcc4a4SLionel Sambucstring and has not been bound previously, 315*36dcc4a4SLionel Sambuc.Fn bindtextdomain 316*36dcc4a4SLionel Sambucbinds 317*36dcc4a4SLionel Sambuc.Fa domainname 318*36dcc4a4SLionel Sambucwith 319*36dcc4a4SLionel Sambuc.Fa dirname . 320*36dcc4a4SLionel Sambuc.Pp 321*36dcc4a4SLionel SambucIf 322*36dcc4a4SLionel Sambuc.Fa domainname 323*36dcc4a4SLionel Sambucis a non-empty string and has been bound previously, 324*36dcc4a4SLionel Sambuc.Fn bindtextdomain 325*36dcc4a4SLionel Sambucreplaces the old binding with dirname. 326*36dcc4a4SLionel SambucThe dirname argument 327*36dcc4a4SLionel Sambuccan be an absolute pathname being resolved when 328*36dcc4a4SLionel Sambuc.Fn gettext , 329*36dcc4a4SLionel Sambuc.Fn ngettext , 330*36dcc4a4SLionel Sambuc.Fn dgettext , 331*36dcc4a4SLionel Sambuc.Fn dngettext , 332*36dcc4a4SLionel Sambuc.Fn dcgettext , 333*36dcc4a4SLionel Sambucor 334*36dcc4a4SLionel Sambuc.Fn dcngettext 335*36dcc4a4SLionel Sambucare called. 336*36dcc4a4SLionel SambucIf 337*36dcc4a4SLionel Sambuc.Fa domainname 338*36dcc4a4SLionel Sambucis a 339*36dcc4a4SLionel Sambuc.Dv NULL 340*36dcc4a4SLionel Sambucpointer or an empty string, 341*36dcc4a4SLionel Sambuc.Fn bindtextdomain 342*36dcc4a4SLionel Sambucreturns a 343*36dcc4a4SLionel Sambuc.Dv NULL 344*36dcc4a4SLionel Sambucpointer. 345*36dcc4a4SLionel SambucIf 346*36dcc4a4SLionel Sambuc.Fn bindtextdomain 347*36dcc4a4SLionel Sambucis not called, implementation-defined default directory is used. 348*36dcc4a4SLionel Sambuc.Pp 349*36dcc4a4SLionel SambucThe 350*36dcc4a4SLionel Sambuc.Fn bind_textdomain_codeset 351*36dcc4a4SLionel Sambucfunction can be used to specify the output 352*36dcc4a4SLionel Sambuc.Fa codeset 353*36dcc4a4SLionel Sambucfor message catalogs for domain 354*36dcc4a4SLionel Sambuc.Fa domainname . 355*36dcc4a4SLionel SambucThe 356*36dcc4a4SLionel Sambuc.Fa codeset 357*36dcc4a4SLionel Sambucargument must 358*36dcc4a4SLionel Sambucbe a valid codeset name which can be used for the 359*36dcc4a4SLionel Sambuc.Xr iconv_open 3 360*36dcc4a4SLionel Sambucfunction. 361*36dcc4a4SLionel Sambuc.Pp 362*36dcc4a4SLionel SambucIf the 363*36dcc4a4SLionel Sambuc.Fa codeset 364*36dcc4a4SLionel Sambucargument is the 365*36dcc4a4SLionel Sambuc.Dv NULL 366*36dcc4a4SLionel Sambucpointer, 367*36dcc4a4SLionel Sambuc.Fn bind_textdomain_codeset 368*36dcc4a4SLionel Sambucreturns the currently selected 369*36dcc4a4SLionel Sambuc.Fa codeset 370*36dcc4a4SLionel Sambucfor the domain with the name 371*36dcc4a4SLionel Sambuc.Fa domainname . 372*36dcc4a4SLionel SambucIt returns a 373*36dcc4a4SLionel Sambuc.Dv NULL 374*36dcc4a4SLionel Sambucpointer if no 375*36dcc4a4SLionel Sambuc.Fa codeset 376*36dcc4a4SLionel Sambuchas yet been selected. 377*36dcc4a4SLionel Sambuc.Pp 378*36dcc4a4SLionel SambucThe 379*36dcc4a4SLionel Sambuc.Fn bind_textdomain_codeset 380*36dcc4a4SLionel Sambucfunction can be used several times. 381*36dcc4a4SLionel SambucIf used multiple times, with the same 382*36dcc4a4SLionel Sambuc.Fa domainname 383*36dcc4a4SLionel Sambucargument, 384*36dcc4a4SLionel Sambucthe later call overrides the 385*36dcc4a4SLionel Sambucsettings made by the earlier one. 386*36dcc4a4SLionel Sambuc.Pp 387*36dcc4a4SLionel SambucThe 388*36dcc4a4SLionel Sambuc.Fn bind_textdomain_codeset 389*36dcc4a4SLionel Sambucfunction returns a pointer to a string containing 390*36dcc4a4SLionel Sambucthe name of the selected 391*36dcc4a4SLionel Sambuc.Fa codeset . 392*36dcc4a4SLionel Sambuc.\".Sh "RETURN VALUES" 393*36dcc4a4SLionel Sambuc.\".Sh EXAMPLES 394*36dcc4a4SLionel Sambuc.Sh SEE ALSO 395*36dcc4a4SLionel Sambuc.Xr setlocale 3 , 396*36dcc4a4SLionel Sambuc.Xr nls 7 397*36dcc4a4SLionel Sambuc.\".Sh STANDARDS 398*36dcc4a4SLionel Sambuc.Sh HISTORY 399*36dcc4a4SLionel SambucThe functions are implemented by Citrus project, 400*36dcc4a4SLionel Sambucbased on the documentations for GNU gettext. 401*36dcc4a4SLionel Sambuc.Sh BUGS 402*36dcc4a4SLionel Sambuc.\" The text was ripped off from Annex C of 403*36dcc4a4SLionel Sambuc.\" .Dq LI18NUX 2000 Globalization Specification Version 1.0 . 404*36dcc4a4SLionel Sambuc.\" .Pp 405*36dcc4a4SLionel Sambuc.Fn bind_textdomain_codeset 406*36dcc4a4SLionel Sambucdoes not work at this moment 407*36dcc4a4SLionel Sambuc.Pq it always fails . 408