5 Locale::Codes - a distribution of modules to handle locale codes
9 B<Locale-Codes> is a distribution containing a set of modules. The
10 modules each deal with different types of codes which identify parts
11 of the locale including languages, countries, currency, etc.
13 Currently, the following modules are included:
17 =item B<Locale::Codes::Country, Locale::Country>
19 This includes support for country codes (such as those listed in ISO-3166)
20 to specify the country.
22 Because this module was originally distributed as Locale::Country, it is
23 also available under that name.
25 =item B<Locale::Codes::Language, Locale::Language>
27 This includes support for language codes (such as those listed in ISO-639)
28 to specify the language.
30 Because this module was originally distributed as Locale::Language, it is
31 also available under that name.
33 =item B<Locale::Codes::Currency, Locale::Currency>
35 This includes support for currency codes (such as those listed in ISO-4217)
36 to specify the currency.
38 Because this module was originally distributed as Locale::Currency, it is
39 also available under that name.
41 =item B<Locale::Codes::Script, Locale::Script>
43 This includes support for script codes (such as those listed in ISO-15924)
44 to specify the script.
46 Because this module was originally distributed as Locale::Script, it is
47 also available under that name.
49 =item B<Locale::Codes::LangExt>
51 This includes support for language extension codes (such as those listed
52 in the IANA language registry) to specify the language extension.
54 =item B<Locale::Codes::LangVar>
56 This includes support for language variation codes (such as those listed
57 in the IANA language registry) to specify the language variation.
59 =item B<Locale::Codes::LangFam>
61 This includes support for language family codes (such as those listed
62 in ISO 639-5) to specify families of languages.
66 Each module can support an arbitrary number of code sets, and it is
67 not required that the relationship between these code sets be
68 one-to-one. For example, the Locale::Codes::Country module supports
69 code sets from ISO-3166 and the IANA standard, and they do not
70 break the world down into exactly the same sets of countries. This
71 does not cause any problem (though converting codes from ISO-3166 to
72 IANA or back will not work except for countries that are one-to-one).
74 All data in all of these modules comes directly from the original
75 standards (or as close to direct as possible), so it should be
76 up-to-date at the time of release.
78 I plan on releasing a new version several times a year to incorporate
79 any changes made in the standards. However, I don't always know about
80 changes that occur, so if any of the standards change, and you want a
81 new release sooner, just email me and I'll get one out.
83 In addition to the modules above, there are a number of support modules included
84 in the distribution including:
88 =item B<Locale::Codes>
90 =item B<Locale::Codes::Constants>
92 =item B<Locale::Codes::Country_codes>
94 =item B<Locale::Codes::Language_codes>
96 =item B<Locale::Codes::Currency_codes>
98 =item B<Locale::Codes::Script_codes>
100 =item B<Locale::Codes::LangExt_codes>
102 =item B<Locale::Codes::LangVar_codes>
104 =item B<Locale::Codes::LangFam_codes>
108 These modules are not intended to be used by programmers. They contain functions
109 or data that are used by the modules listed above.
113 I'm always open to suggestions for new code sets.
115 In order for me to add a code set, I want the following criteria
120 =item B<General-use code set>
122 If a code set is not general use, I'm not likely to spend the time
123 to add and support it.
125 =item B<An official source of data>
127 I require an official (or at least, a NEARLY official) source where I
128 can get the data on a regular basis.
130 Ideally, I'd only get data from an official source, but sometimes that
131 is not possible. For example the ISO standards are not typically
132 available for free, so I may have to get some of that data from
133 alternate sources that I'm confident are getting their data from the
134 official source. However, I will always be hesitant to accept a
137 As an example, I used to get some country data from the CIA World
138 Factbook. Given the nature of the source, I'm sure they're updating
139 data from the official sources and I consider it "nearly" official.
140 However, even in this case, I found that they were adding codes that
141 were not part of the standard, so I have stopped using them as a
144 There are many 3rd party sites which maintain lists (many of which are
145 actually in a more convenient form than the official sites).
146 Unfortunately, I will reject most of them since I have no feel for how
149 =item B<A free source of the data>
151 Obviously, the data must be free-of-charge. I'm not interested in
152 paying for the data (and I'm not interested in the overhead of having
153 someone else pay for the data for me).
155 =item B<A reliable source of data>
157 The source of data must come from a source that I can reasonably expect
158 to exist for the foreseeable future since I will be extremely reluctant
159 to drop support for a data set once it's included.
161 I am also reluctant to accept data sent to me by an individual.
162 Although I appreciate the offer, it is simply not practical to consider
163 an individual contribution as a reliable source of data. The source
164 should be an official agency of some sort.
168 These requirements are open to discussion. If you have a code set
169 you'd like to see added, but which may not meet all of the above
170 requirements, feel free to email me and we'll discuss it. Depending
171 on circumstances, I may be willing to waive some of these criteria.
173 =head1 COMMON ALIASES
175 As of version 2.00, the modules supported common variants of names.
177 For example, Locale::Country supports variant names for countries, and
178 a few of the most common ones are included in the data. The country
179 code for "United States" is "us", so:
181 country2code('United States');
184 Now the following will also return 'us':
186 country2code('United States of America');
189 Any number of common aliases may be included in the data, in addition
190 to the names that come directly from the standards. If you have a
191 common alias for a country, language, or any other of the types of
192 codes, let me know and I'll add it, with some restrictions.
194 For example, the country name "North Korea" never appeared in any of
195 the official sources (instead, it was "Korea, North" or "Korea,
196 Democratic People's Republic of". I would honor a request to add an
197 alias "North Korea" since that's a very common way to specify the
198 country (please don't request this... I've already added it).
200 On the other hand, a request to add Zaire as an alias for "Congo, The
201 Democratic Republic of" will not be honored. The country's official
202 name is no longer Zaire, so adding it as an alias violates the standard.
203 Zaire was kept as an alias in versions prior to 3.00, but it has been
204 removed. Other aliases (if any) which no longer appear in any standard
205 (and which are not common variations of the name in the standards)
206 have also been removed.
208 =head1 DEPRECATED CODES
210 Occasionally, a code is deprecated, but it may still be desirable to
213 Although there is no way to see every code that has ever existed and
214 been deprecated (since most codesets do not have that information
215 available), as of version 3.20, every code which has ever been included
216 in these modules can be referenced.
218 For more information, refer to the documentation on the code2XXX, XXX2code,
219 all_XXX_codes, and all_XXX_names function in the B<Locale::Codes::API>
226 =item B<Locale::Codes::API>
228 The list of functions available in each of the modules listed below.
229 The APIs for each module are exactly identical.
231 =item B<Locale::Codes::Country>
233 Codes for identification of countries.
235 =item B<Locale::Codes::Language>
237 Codes for identification of languages.
239 =item B<Locale::Codes::Script>
241 Codes for identification of scripts.
243 =item B<Locale::Codes::Currency>
245 Codes for identification of currencies and funds.
247 =item B<Locale::Codes::LangExt>
249 Codes for identification of language extensions.
251 =item B<Locale::Codes::LangVar>
253 Codes for identification of language variations.
255 =item B<Locale::Codes::LangFam>
257 Codes for identification of language families.
259 =item B<Locale::Codes::Changes>
261 A history of changes made to this distribution.
267 Locale::Country and Locale::Language were originally written by Neil
268 Bowers at the Canon Research Centre Europe (CRE). They maintained the
269 distribution from 1997 to 2001.
271 Locale::Currency was originally written by Michael Hennecke and was
272 modified by Neil Bowers for inclusion in the distribution.
274 From 2001 to 2004, maintenance was continued by Neil Bowers. He
275 modified Locale::Currency for inclusion in the distribution. He also
276 added Locale::Constants and Locale::Script.
278 From 2004-2009, the module was unmaintained.
280 In 2010, maintenance was taken over by Sullivan Beck (sbeck@cpan.org)
281 with Neil Bower's permission. All problems or comments should be
282 sent there. Alternately, problems can be reported using the
283 perl problem tracker at:
285 https://rt.cpan.org/Dist/Display.html?Queue=Locale-Codes
289 Copyright (c) 1997-2001 Canon Research Centre Europe (CRE).
290 Copyright (c) 2001 Michael Hennecke (Locale::Currency)
291 Copyright (c) 2001-2010 Neil Bowers
292 Copyright (c) 2010-2013 Sullivan Beck
294 This module is free software; you can redistribute it and/or
295 modify it under the same terms as Perl itself.