.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Locale::Codes::Types 3perl" .TH Locale::Codes::Types 3perl "2019-03-31" "perl v5.28.1" "Perl Programmers Reference Guide" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Locale::Codes::Types \- types of data sets supported .SH "DESCRIPTION" .IX Header "DESCRIPTION" This document contains a description of different types of code sets supported by the \fBLocale-Codes\fR distribution. .PP The following types are supported: .ie n .IP """country""" 4 .el .IP "``country''" 4 .IX Item "country" .PD 0 .ie n .IP """language""" 4 .el .IP "``language''" 4 .IX Item "language" .ie n .IP """currency""" 4 .el .IP "``currency''" 4 .IX Item "currency" .ie n .IP """script""" 4 .el .IP "``script''" 4 .IX Item "script" .ie n .IP """langfam""" 4 .el .IP "``langfam''" 4 .IX Item "langfam" .ie n .IP """langvar""" 4 .el .IP "``langvar''" 4 .IX Item "langvar" .ie n .IP """langext""" 4 .el .IP "``langext''" 4 .IX Item "langext" .PD .PP Any time you have to specify the type of data, use one of the values from this list. When using the \s-1OO\s0 interface, you have to specify the type of data you are working with. For example: .PP .Vb 4 \& use Locale::Codes; \& ... \& $obj\->type(\*(Aqcountry\*(Aq); \& $obj\->type(\*(Aqlangext\*(Aq); .Ve .PP When using the traditional interfaces, the functions all have the data type included in the function name. For example: .PP .Vb 2 \& use Locale::Codes::Country; \& code2country(...); \& \& use Locale::Codes::LangExt; \& code2langext(...); .Ve .PP Each type of data may have any number of code sets. Code sets may be specified by name. Traditionally, a perl constant was exported and could also be used to specify the code set. .PP Both methods are available for both the \s-1OO\s0 and traditional interfaces, so whenever a function or method takes an argument specifying a code set, either the name or a constant can be used. .PP In the lists below, a code set is specified in the list by including the name and the constant. So, for example, the first country code set is named \f(CW\*(Aqalpha\-2\*(Aq\fR and has a perl constant \f(CW\*(C`LOCALE_COUNTRY_ALPHA_2\*(C'\fR associated with it. When using the \s-1OO\s0 interface, the constants are only available if you import them by loading the module with: .PP .Vb 1 \& use Locale::Codes \*(Aq:constants\*(Aq; .Ve .PP The constants are always available when using the traditional interfaces. .PP Some of the older perl constants names were not consistent, and in those cases, two constants are available (a newer consistent name and the older inconsistent one). Either may be used. .PP The default code set for each type is marked with an asterisk (*). .SH "country" .IX Header "country" Code sets for identifying countries are maintained by several different agencies and standards. .PP The following code sets are maintained in the \s-1ISO 3166\s0 standard. The official home page for the \s-1ISO 3166\s0 maintenance agency is: . .PP Only the officially assigned codes are included. .IP "\fB* alpha\-2, \s-1LOCALE_COUNTRY_ALPHA_2, LOCALE_CODE_ALPHA_2\s0\fR" 4 .IX Item "* alpha-2, LOCALE_COUNTRY_ALPHA_2, LOCALE_CODE_ALPHA_2" This is the set of two-letter (lowercase) codes from \s-1ISO 3166\-1,\s0 such as 'tv' for Tuvalu. .IP "\fBalpha\-3, \s-1LOCALE_COUNTRY_ALPHA_3, LOCALE_CODE_ALPHA_3\s0\fR" 4 .IX Item "alpha-3, LOCALE_COUNTRY_ALPHA_3, LOCALE_CODE_ALPHA_3" This is the set of three-letter (lowercase) codes from \s-1ISO 3166\-1,\s0 such as 'brb' for Barbados. These codes are actually defined and maintained by the U.N. Statistics division. .IP "\fBnumeric, \s-1LOCALE_COUNTRY_NUMERIC, LOCALE_CODE_NUMERIC\s0\fR" 4 .IX Item "numeric, LOCALE_COUNTRY_NUMERIC, LOCALE_CODE_NUMERIC" This is the set of three-digit numeric codes from \s-1ISO 3166\-1,\s0 such as 064 for Bhutan. .Sp If a 2\-digit code is entered, it is converted to 3 digits by prepending a 0. .PP A list of domain names are maintained by the \s-1IANA\s0 (Internet Assigned Numbers Authority). These are available at: . Only the actual country codes are used, and the country names come from \s-1ISO 3166.\s0 .IP "\fBdom, \s-1LOCALE_COUNTRY_DOM, LOCALE_CODE_DOM\s0\fR" 4 .IX Item "dom, LOCALE_COUNTRY_DOM, LOCALE_CODE_DOM" The country domains assigned by \s-1IANA\s0 are usually the two-letter (lowercase) codes from \s-1ISO 3166,\s0 but there are a few other additions. .PP The United Nations also maintains country lists. Their list is also similar, but not identical, to the \s-1ISO 3166\s0 list. .PP The data is available here: .PP Previously, this table was treated as a source of the \s-1ISO 3166\s0 data, but I found that the table was incomplete, so I stopped using it. Later, it was added back in as it's own list of codes. .IP "\fBun\-alpha\-3, \s-1LOCALE_COUNTRY_UN_ALPHA_3, LOCALE_CODE_UN_ALPHA_3\s0\fR" 4 .IX Item "un-alpha-3, LOCALE_COUNTRY_UN_ALPHA_3, LOCALE_CODE_UN_ALPHA_3" This is similar to the 'alpha\-3' set from \s-1ISO 3166,\s0 except that the codes are uppercase. .IP "\fBun-numeric, \s-1LOCALE_COUNTRY_UN_NUMERIC, LOCALE_CODE_UN_NUMERIC\s0\fR" 4 .IX Item "un-numeric, LOCALE_COUNTRY_UN_NUMERIC, LOCALE_CODE_UN_NUMERIC" This is similar to the 'numeric' set from \s-1ISO 3166.\s0 .PP The \s-1US\s0 Government also keeps a list of codes. Originally, it maintained the \s-1FIPS\-11\s0 code set, but this was deprecated and replaced by the \s-1GENC\s0 code set. The \s-1FIPS\-11\s0 code sets are no longer supported by \fBLocale-Codes\fR. .PP The \s-1GENC\s0 code sets are available here: . They are also similar, but not identical, to the \s-1ISO 3166\s0 code sets. .IP "\fBgenc\-alpha\-2, \s-1LOCALE_COUNTRY_GENC_ALPHA_2, LOCALE_CODE_GENC_ALPHA_2\s0\fR" 4 .IX Item "genc-alpha-2, LOCALE_COUNTRY_GENC_ALPHA_2, LOCALE_CODE_GENC_ALPHA_2" Similar to the 'alpha\-2' set, but uppercase. .IP "\fBgenc\-alpha\-3, \s-1LOCALE_COUNTRY_GENC_ALPHA_3, LOCALE_CODE_GENC_ALPHA_3\s0\fR" 4 .IX Item "genc-alpha-3, LOCALE_COUNTRY_GENC_ALPHA_3, LOCALE_CODE_GENC_ALPHA_3" Similar to the 'alpha\-3' set, but uppercase. .IP "\fBgenc-numeric, \s-1LOCALE_COUNTRY_GENC_NUMERIC, LOCALE_CODE_GENC_NUMERIC\s0\fR" 4 .IX Item "genc-numeric, LOCALE_COUNTRY_GENC_NUMERIC, LOCALE_CODE_GENC_NUMERIC" Similar to the 'numeric' set. .PP There are other sources of codes that are not currently used in this distribution. .PP \&\s-1ISO\s0 codes for country sub-divisions (states, counties, provinces, etc), as defined in \s-1ISO 3166\-2.\s0 This module is not part of the Locale-Codes distribution, but is available from \s-1CPAN\s0 in CPAN/modules/by\-module/Locale/ .PP The World Factbook maintained by the \s-1CIA\s0 is a potential source of the data. Unfortunately, it adds/preserves non-standard codes, so it is not used as a source of data. .PP Another unofficial source of data is the Statoids web site: . Currently, it is not used to get data, but the notes and explanatory material were very useful for understanding discrepancies between the sources. .SH "language" .IX Header "language" Code sets for identifying languages come from a couple different locations. .PP The primary source is \s-1ISO 639 .\s0 The \s-1ISO 639\-2\s0 codes are available here: and the \s-1ISO 639\-5\s0 codes are available here: . .PP In addition, the \s-1IANA\s0 maintains a language registry which are added to the \s-1ISO\s0 lists. Because it is intended to supplement the \s-1ISO\s0 standard, the \s-1IANA\s0 list is not separate. .PP The \s-1IANA\s0 data is available here: .PP The code sets are: .IP "\fB* alpha\-2, \s-1LOCALE_LANGUAGE_ALPHA_2, LOCALE_LANG_ALPHA_2\s0\fR" 4 .IX Item "* alpha-2, LOCALE_LANGUAGE_ALPHA_2, LOCALE_LANG_ALPHA_2" This is the set of two-letter (lowercase) codes from \s-1ISO 639\-1,\s0 such as 'he' for Hebrew. It also includes additions to this set included in the \s-1IANA\s0 language registry. .IP "\fBalpha\-3, \s-1LOCALE_LANGUAGE_ALPHA_3, LOCALE_LANG_ALPHA_3\s0\fR" 4 .IX Item "alpha-3, LOCALE_LANGUAGE_ALPHA_3, LOCALE_LANG_ALPHA_3" This is the set of three-letter (lowercase) bibliographic codes from \&\s-1ISO 639\-2\s0 and 639\-5, such as 'heb' for Hebrew. It also includes additions to this set included in the \s-1IANA\s0 language registry. .IP "\fBterm, \s-1LOCALE_LANGUAGE_TERM, LOCALE_LANG_TERM\s0\fR" 4 .IX Item "term, LOCALE_LANGUAGE_TERM, LOCALE_LANG_TERM" This is the set of three-letter (lowercase) terminologic codes from \&\s-1ISO 639.\s0 .SH "currency" .IX Header "currency" The source of currency codes is the \s-1ISO 4217\s0 data available here: .PP The code sets are: .IP "\fB* alpha, \s-1LOCALE_CURRENCY_ALPHA, LOCALE_CURR_ALPHA\s0\fR" 4 .IX Item "* alpha, LOCALE_CURRENCY_ALPHA, LOCALE_CURR_ALPHA" This is a set of three-letter (uppercase) codes from \s-1ISO 4217\s0 such as \s-1EUR\s0 for Euro. .Sp Two of the codes specified by the standard (\s-1XTS\s0 which is reserved for testing purposes and \s-1XXX\s0 which is for transactions where no currency is involved) are omitted. .IP "\fBnum, \s-1LOCALE_CURRENCY_NUMERIC, LOCALE_CURR_NUMERIC\s0\fR" 4 .IX Item "num, LOCALE_CURRENCY_NUMERIC, LOCALE_CURR_NUMERIC" This is the set of three-digit numeric codes from \s-1ISO 4217.\s0 .SH "script" .IX Header "script" The source of script code sets is \s-1ISO 15924\s0 available here: .PP Additional data comes from the \s-1IANA\s0 language subtag registry: . .PP Code sets are: .IP "\fB* alpha, \s-1LOCALE_SCRIPT_ALPHA\s0\fR" 4 .IX Item "* alpha, LOCALE_SCRIPT_ALPHA" This is a set of four-letter (capitalized) codes from \s-1ISO 15924\s0 such as 'Phnx' for Phoenician. It also includes additions to this set included in the \s-1IANA\s0 language registry. .Sp The Zxxx, Zyyy, and Zzzz codes are not used. .IP "\fBnum, \s-1LOCALE_SCRIPT_NUMERIC\s0\fR" 4 .IX Item "num, LOCALE_SCRIPT_NUMERIC" This is a set of three-digit numeric codes from \s-1ISO 15924\s0 such as 115 for Phoenician. .SH "langfam" .IX Header "langfam" Language families are specified using codes from \s-1ISO 639\-5\s0 available here: .PP Code sets are: .IP "\fB* alpha, \s-1LOCALE_LANGFAM_ALPHA\s0\fR" 4 .IX Item "* alpha, LOCALE_LANGFAM_ALPHA" This is the set of three-letter (lowercase) codes from \s-1ISO 639\-5\s0 such as 'apa' for Apache languages. .SH "langvar" .IX Header "langvar" Language variations are specified using codes from he \s-1IANA\s0 language subtag registry available here: .PP Code sets are: .IP "\fB* alpha, \s-1LOCALE_LANGVAR_ALPHA\s0\fR" 4 .IX Item "* alpha, LOCALE_LANGVAR_ALPHA" This is the set of alphanumeric codes from the \s-1IANA\s0 language registry, such as 'arevela' for Eastern Armenian. .SH "langext" .IX Header "langext" Language extensions are specified using codes from he \s-1IANA\s0 language subtag registry available here: .PP Code sets are: .IP "\fB* alpha, \s-1LOCALE_LANGEXT_ALPHA\s0\fR" 4 .IX Item "* alpha, LOCALE_LANGEXT_ALPHA" This is the set of three-letter (lowercase) codes from the \s-1IANA\s0 language registry, such as 'acm' for Mesopotamian Arabic. .SH "NEW CODE SETS" .IX Header "NEW CODE SETS" I'm always open to suggestions for new code sets. .PP In order for me to add a code set, I want the following criteria to be met: .IP "\fBGeneral-use code set\fR" 4 .IX Item "General-use code set" If a code set is not general use, I'm not likely to spend the time to add and support it. .IP "\fBAn official source of data\fR" 4 .IX Item "An official source of data" I require an official (or at least, a \s-1NEARLY\s0 official) source where I can get the data on a regular basis. .Sp Ideally, I'd only get data from an official source, but sometimes that is not possible. For example the \s-1ISO\s0 standards are not typically available for free, so I may have to get some of that data from alternate sources that I'm confident are getting their data from the official source. However, I will always be hesitant to accept a non-official source. .Sp As an example, I used to get some country data from the \s-1CIA\s0 World Factbook. Given the nature of the source, I'm sure they're updating data from the official sources and I consider it \*(L"nearly\*(R" official. However, even in this case, I found that they were adding codes that were not part of the standard, so I have stopped using them as a source. .Sp There are many 3rd party sites which maintain lists (many of which are actually in a more convenient form than the official sites). Unfortunately, I will reject most of them since I have no feel for how \&\*(L"official\*(R" they are. .IP "\fBA free source of the data\fR" 4 .IX Item "A free source of the data" Obviously, the data must be free-of-charge. I'm not interested in paying for the data (and I'm not interested in the overhead of having someone else pay for the data for me). .IP "\fBA reliable source of data\fR" 4 .IX Item "A reliable source of data" The source of data must come from a source that I can reasonably expect to exist for the foreseeable future since I will be extremely reluctant to drop support for a data set once it's included. .Sp I am also reluctant to accept data sent to me by an individual. Although I appreciate the offer, it is simply not practical to consider an individual contribution as a reliable source of data. The source should be an official agency of some sort. .PP These requirements are open to discussion. If you have a code set you'd like to see added, but which may not meet all of the above requirements, feel free to email me and we'll discuss it. Depending on circumstances, I may be willing to waive some of these criteria. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "Locale::Codes" 4 .IX Item "Locale::Codes" The Locale-Codes distribution. .SH "AUTHOR" .IX Header "AUTHOR" See Locale::Codes for full author history. .PP Currently maintained by Sullivan Beck (sbeck@cpan.org). .SH "COPYRIGHT" .IX Header "COPYRIGHT" .Vb 3 \& Copyright (c) 1997\-2001 Canon Research Centre Europe (CRE). \& Copyright (c) 2001\-2010 Neil Bowers \& Copyright (c) 2010\-2018 Sullivan Beck .Ve .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.