�ɲɾ�����ӯ�����һ��ˣ��������С���˴��ͣ�������P���ҹ��ñ˽��ά�Բ��������˸߸ԣ�������ơ��ҹ��ñ�����ά�Բ���ˡ���˳^�ӣ������ӡ� ���ͯj�ӣ��ƺ���ӣ� ? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!README.first000064400000001446152527153710006567 0ustar00 Locale-Codes Distribution This distribution contains Perl modules which can be used to process ISO codes for identifying languages, countries, scripts, and currencies & funds. It consists of a number of modules used for each of the different types of codes. For example, to deal with country codes, use the: Locale::Codes::Country module. Please refer to the Locale::Codes manual for a list of modules included in this distribution. The modules are documented using pod. When you "make install", you will get man-pages: Local::Codes and each of the modules listed above. I plan on releasing a new version about several times a year to make sure that all of the codes are current. If a code changes in any standard, and you want a new release, just email me and I'll put out a new release. examples/code2country000064400000000673152527153710010743 0ustar00#!/usr/bin/perl -w require 5.002; use Locale::Codes::Country; print code2country("BO"),"\n"; print code2country("BO",LOCALE_CODE_ALPHA_2),"\n"; print code2country("bol",LOCALE_CODE_ALPHA_3),"\n"; # Local Variables: # mode: cperl # indent-tabs-mode: nil # cperl-indent-level: 3 # cperl-continued-statement-offset: 2 # cperl-continued-brace-offset: 0 # cperl-brace-offset: 0 # cperl-brace-imaginary-offset: 0 # cperl-label-offset: 0 # End: examples/country2code000064400000001254152527153710010737 0ustar00#!/usr/bin/perl -w require 5.002; use Locale::Codes::Country; print country2code('Bolivia'),"\n"; print country2code('Bolivia, Plurinational State of'),"\n"; print country2code('Bolivia (Plurinational State of)'),"\n"; print country2code('Bolivia',LOCALE_CODE_ALPHA_3),"\n"; print country2code('Bolivia, Plurinational State of',LOCALE_CODE_ALPHA_3),"\n"; print country2code('Bolivia (Plurinational State of)',LOCALE_CODE_ALPHA_3),"\n"; # Local Variables: # mode: cperl # indent-tabs-mode: nil # cperl-indent-level: 3 # cperl-continued-statement-offset: 2 # cperl-continued-brace-offset: 0 # cperl-brace-offset: 0 # cperl-brace-imaginary-offset: 0 # cperl-label-offset: 0 # End: README000064400000053055152527153710005444 0ustar00NAME Locale::Codes - a distribution of modules to handle locale codes DESCRIPTION Locale-Codes is a distribution containing a set of modules designed to work with sets of codes which uniquely identify something. For example, there are codes associated with different countries, different currencies, different languages, etc. These sets of codes are typically maintained in some standard. This distribution provides a way to work with these lists of codes. Because the data from the various standards is not available in any sort of consistent API, access to the lists is not available in any direct fashion. To compensate for this, the list of codes is stored internally within this distribution, and the distribution is updated on a regular basis to include all known codes at that point in time. This does mean that it is necessary to keep this distribution up-to-date to keep up with the various changes that are made in the various standards. Traditionally, a module has been created to work with each type of code sets. So, there is a module for working with country lists, one for currency lists, etc. Since version 3.00, all of these individual modules were written as wrappers around a central module (which was not intended to be used directly) which did all of the real work. Starting with version 3.50, the central module was reworked slightly to provide an object-oriented interface. All of the modules for working with individual types of code sets were reworked to use the improved OO module, so the traditional interfaces still work as they always have. As a result, you are free to use the traditional functional (non-OO) interfaces, or to use the OO interface and bypass the wrapper modules entirely. Both methods will be supported in the future, so use the one that is best suited to your needs. Within each type, any number of code sets are allowed. For example, sets of country codes are maintained in several different locations including the ISO-3166 standard, the IANA, and by the United Nations. The lists of countries are similar, but not identical. Multiple code sets are supported, though trying to convert from one code set to another will not always work since the list of countries is not one-to-one. All data in all of these modules comes directly from the original standards (or as close to direct as possible), so it should be up-to-date at the time of release. I plan on releasing a new version several times a year to incorporate any changes made in the standards. However, I don't always know about changes that occur, so if any of the standards change, and you want a new release sooner, just email me and I'll get one out. SYNOPSIS (OBJECT-ORIENTED INTERFACE) use Locale::Codes; or use Locale::Codes ':constants'; $obj = new Locale::Codes 'country'; OBJECT-ORIENTED METHODS The following methods are available. In all methods, when specifying a code set, the name (as a string) is always available. Traditionally, you could also use a perl constant to specify the code set. In order to do so with the OO interface, you have to import the constants. To do that, load the module with: use Locale::Codes ':constants'; new ( [TYPE [,CODESET]] ) $obj = new Locale::Codes; $obj = new Locale::Codes 'country'; $obj = new Locale::Codes 'country','alpha-3'; $obj = new Locale::Codes 'country',LOCALE_COUNTRY_ALPHA_3; This creates a new object that can access the data. If no type is specified (in the first argument), you must use the type method described below. No operations will work unless the type is specified. The second argument is the default code set to use. This is optional, as each type has a default code set. The default code set can be set using the codeset method below. The last example is only available if the constants were imported when the module was loaded. show_errors ( FLAG ) $obj->show_errors(1); $obj->show_errors(0); By default, error messages will be produced when bad data is passed to any method. By passing in '0', these will be turned off so that all failures will be silent. type ( TYPE ) $obj->type($type) This will set the type of codes that will be worked with. $type may be any of the recognized types of code sets, including: country language currency script etc. The list of valid types, and the code sets supported in each, are described in the Locale::Codes::Types document. This method can be called any number of times to toggle between different types of code sets. codeset ( CODESET ) $obj->codeset($codeset); This sets the default code set to use. The list of code sets available for each type are described in the Locale::Codes::Types document. In all other methods below, when an optional CODESET argument is omitted, it will default to this value. code2name ( CODE [,CODESET] [,'retired'] ) $name = $obj->code2name($code [,$codeset] [,'retired']); This functions take a code and returns a string which contains the name of the element identified. If the code is not a valid code in the CODESET specified then "undef" will be returned. The name of the element is the name as specified in the standard, and as a result, different variations of an element name may be returned for different values of CODESET. For example, the alpha-2 country code set defines the two-letter code "bo" to be "Bolivia, Plurinational State of", whereas the alpha-3 code set defines the code 'bol' to be the country "Bolivia (Plurinational State of)". So: $obj->code2name('bo','alpha-2'); => 'Bolivia, Plurinational State of' $obj->code2name('bol','alpha-3'); => 'Bolivia (Plurinational State of)' By default, only active codes will be used, but if the string 'retired' is passed in as an argument, both active and retired codes will be examined. name2code ( NAME [,CODESET] [,'retired'] ) $code = $obj->name2code($name [,$codeset] [,'retired']); This function takes the name of an element (or any of it's aliases) and returns the code that corresponds to it, if it exists. If NAME could not be identified as the name of one of the elements, then "undef" will be returned. The name is not case sensitive. Also, any known variation of a name may be passed in. For example, even though the country name returned using 'alpha-2' and 'alpha-3' country codes for Bolivia are different, either country name may be passed in since for each code set (in addition to the more common alias 'Bolivia'). So: $obj->name2code('Bolivia, Plurinational State of','alpha-2'); => bo $obj->name2code('Bolivia (Plurinational State of)','alpha-2'); => bo $obj->name2code('Bolivia','alpha-2'); => bo By default, only active names will be used, but if the string 'retired' is passed in as an argument, both active and retired names will be examined. code2code ( CODE [,CODESET] ,CODESET2 ) $code = $obj->code2code($code [,$codeset] ,$codeset2); This function takes a code from one code set (CODESET or the default code set), and returns the corresponding code from another code set (CODESET2). CODE must exists in the code set specified by CODESET and must have a corresponding code in the code set specified by CODESET2 or "undef" will be returned. $obj->code2code('fin','alpha-3','alpha-2'); => 'fi' Note that this function does NOT support retired codes. all_codes ( [CODESET] [,'retired'] ) @code = $obj->all_codes([$codeset] [,'retired']); This returns a list of all code in the code set. The codes will be sorted. By default, only active codes will be returned, but if the string 'retired' is passed in as an argument, both active and retired codes will be returned. all_names ( [CODESET] [,'retired'] ) @name = $obj->all_names([$codeset] [,'retired']); This method returns a list of all elements names for which there is a corresponding code in the specified code set. The names returned are exactly as they are specified in the standard, and are sorted. Since not all elements are listed in all code sets, the list of elements may differ depending on the code set specified. By default, only active names will be returned, but if the string 'retired' is passed in as an argument, both active and retired names will be returned. The following additional methods are available and can be used to modify the code list data (and are therefore not generally useful). rename_code ( CODE ,NEW_NAME [,CODESET] ) $flag = $obj->rename_code($code,$new_name [,$codeset]); This method can be used to change the official name of an element. At that point, the name returned by the "code2name" method would be NEW_NAME instead of the name specified in the standard. The original name will remain as an alias. For example, the official country name for code 'gb' is 'United Kingdom'. If you want to change that, you might call: $obj->rename_code('gb', 'Great Britain'); This means that calling code2name('gb') will now return 'Great Britain' instead of 'United Kingdom'. If any error occurs, a warning is issued and 0 is returned. An error occurs if CODE doesn't exist in the specified code set, or if NEW_NAME is already in use but for a different element. If the method succeeds, 1 is returned. add_code ( CODE ,NAME [,CODESET] ) $flag = $obj->add_code($code,$name [,$codeset]); This method is used to add a new code and name to the data. Both CODE and NAME must be unused in the data set or an error occurs (though NAME may be used in a different data set). For example, to create the fictitious country named "Duchy of Grand Fenwick" with codes "gf" and "fen", use the following: $obj->add_code("fe","Duchy of Grand Fenwick",'alpha-2'); $obj->add_code("fen","Duchy of Grand Fenwick",'alpha-3'); The return value is 1 on success, 0 on an error. delete_code ( CODE [,CODESET] ) $flag = $obj->delete_code($code [,$codeset]); This method is used to delete a code from the data. CODE must refer to an existing code in the code set. The return value is 1 on success, 0 on an error. add_alias ( NAME ,NEW_NAME ) $flag = $obj->add_alias($name,$new_name); This method is used to add a new alias to the data. They do not alter the return value of the "code2name" function. NAME must be an existing element name, and NEW_NAME must be unused or an error occurs. The return value is 1 on success, 0 on an error. delete_alias ( NAME ) $flag = $obj->delete_alias($name); This method is used to delete an alias from the data. Once removed, the element may not be referred to by NAME. NAME must be one of a list of at least two names that may be used to specify an element. If the element may only be referred to by a single name, you'll need to use the "add_alias" method to add a new alias first, or the "remove_code" method to remove the element entirely. If the alias is used as the name in any code set, one of the other names will be used instead. Predicting exactly which one will be used requires you to know the order in which the standards were read, which is not reliable, so you may want to use the "rename_code" method to force one of the alternate names to be used. The return value is 1 on success, 0 on an error. replace_code ( CODE ,NEW_CODE [,CODESET] ) $flag = $obj->replace_code($code,$new_code [,$codeset]); This method is used to change the official code for an element. At that point, the code returned by the "name2code" method would be NEW_CODE instead of the code specified in the standard. NEW_CODE may either be a code that is not in use, or it may be an alias for CODE (in which case, CODE becomes and alias and NEW_CODE becomes the "real" code). The original code is kept as an alias, so that the "code2name" routines will work with either the code from the standard or the new code. However, the "all_codes" method will only return the codes which are considered "real" (which means that the list of codes will now contain NEW_CODE, but will not contain CODE). add_code_alias ( CODE ,NEW_CODE [,CODESET] ) $flag = $obj->add_code_alias($code,$new_code [,$codeset]); This method adds an alias for the code. At that point, NEW_CODE and CODE will both work in the "code2name" method. However, the "name2code" method will still return the original code. delete_code_alias ( CODE [,CODESET] ) These routines delete an alias for the code. These will only work if CODE is actually an alias. If it is the "real" code, it will not be deleted. You will need to use the "rename_code" method to switch the real code with one of the aliases, and then delete the alias. TRADITIONAL INTERFACES In addition the the primary OO module, the following modules are included in the distribution for the traditional way of working with code sets. Each module will work with one specific type of code sets. Locale::Codes::Country, Locale::Country This includes support for country codes (such as those listed in ISO-3166) to specify the country. Because this module was originally distributed as Locale::Country, it is also available under that name. Locale::Codes::Language, Locale::Language This includes support for language codes (such as those listed in ISO-639) to specify the language. Because this module was originally distributed as Locale::Language, it is also available under that name. Locale::Codes::Currency, Locale::Currency This includes support for currency codes (such as those listed in ISO-4217) to specify the currency. Because this module was originally distributed as Locale::Currency, it is also available under that name. Locale::Codes::Script, Locale::Script This includes support for script codes (such as those listed in ISO-15924) to specify the script. Because this module was originally distributed as Locale::Script, it is also available under that name. Locale::Codes::LangExt This includes support for language extension codes (such as those listed in the IANA language registry) to specify the language extension. Locale::Codes::LangVar This includes support for language variation codes (such as those listed in the IANA language registry) to specify the language variation. Locale::Codes::LangFam This includes support for language family codes (such as those listed in ISO 639-5) to specify families of languages. In addition to the modules above, there are a number of support modules included in the distribution. Any module not listed above falls into that category. These modules are not intended to be used by programmers. They contain functions or data that are used by the modules listed above. No support of any kind is offered for using these modules directly. They may be modified at any time. COMMON ALIASES As of version 2.00, the modules supported common variants of names. For example, Locale::Country supports variant names for countries, and a few of the most common ones are included in the data. The country code for "United States" is "us", so: country2code('United States'); => "us" Now the following will also return 'us': country2code('United States of America'); country2code('USA'); Any number of common aliases may be included in the data, in addition to the names that come directly from the standards. If you have a common alias for a country, language, or any other of the types of codes, let me know and I'll add it, with some restrictions. For example, the country name "North Korea" never appeared in any of the official sources (instead, it was "Korea, North" or "Korea, Democratic People's Republic of". I would honor a request to add an alias "North Korea" since that's a very common way to specify the country (please don't request this... I've already added it). On the other hand, a request to add Zaire as an alias for "Congo, The Democratic Republic of" will not be honored. The country's official name is no longer Zaire, so adding it as an alias violates the standard. Zaire was kept as an alias in versions of this module prior to 3.00, but it has been removed. Other aliases (if any) which no longer appear in any standard (and which are not common variations of the name in the standards) have also been removed. RETIRED CODES Occasionally, a code is deprecated, but it may still be desirable to have access to it. Although there is no way to see every code that has ever existed and been deprecated (since most codesets do not have that information available), as of version 3.20, every code which has ever been included in these modules can be referenced. For more information, refer to the documentation on the code2name, name2code, all_codes, and all_names methods above. SEE ALSO Locale::Codes::Types The list of all code sets available for each type. Locale::Codes::Changes A history of changes made to this distribution. KNOWN BUGS AND LIMITATIONS Relationship between code sets Because each code set uses a slightly different list of elements, and they are not necessarily one-to-one, there may be some confusion about the relationship between codes from different code sets. For example, ISO 3166 assigns one code to the country "United States Minor Outlying Islands", but the IANA codes give different codes to different islands (Baker Island, Howland Island, etc.). This may cause some confusion... I've done the best that I could do to minimize it. Non-ASCII characters not supported Currently all names must be all ASCII. I plan on relaxing that limitation in the future. BUGS AND QUESTIONS If you find a bug in Locale::Codes, there are three ways to send it to me. Any of them are fine, so use the method that is easiest for you. Direct email You are welcome to send it directly to me by email. The email address to use is: sbeck@cpan.org. CPAN Bug Tracking You can submit it using the CPAN tracking too. This can be done at the following URL: GitHub You can submit it as an issue on GitHub. This can be done at the following URL: Please do not use other means to report bugs (such as forums for a specific OS or Linux distribution) as it is impossible for me to keep up with all of them. When filing a bug report, please include the following information: Locale::Codes version Please include the version of Locale::Codes you are using. You can get this by using the script: use Locale::Codes; print $Locale::Codes::VERSION,"\n"; If you want to report missing or incorrect codes, you must be running the most recent version of Locale::Codes. If you find any problems with the documentation (errors, typos, or items that are not clear), please send them to me. I welcome any suggestions that will allow me to improve the documentation. AUTHOR Locale::Country and Locale::Language were originally written by Neil Bowers at the Canon Research Centre Europe (CRE). They maintained the distribution from 1997 to 2001. Locale::Currency was originally written by Michael Hennecke and was modified by Neil Bowers for inclusion in the distribution. From 2001 to 2004, maintenance was continued by Neil Bowers. He modified Locale::Currency for inclusion in the distribution. He also added Locale::Script. From 2004-2009, the module was unmaintained. In 2010, maintenance was taken over by Sullivan Beck (sbeck@cpan.org) with Neil Bower's permission. All problems or comments should be sent to him using any of the methods listed above. COPYRIGHT Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). Copyright (c) 2001 Michael Hennecke (Locale::Currency) Copyright (c) 2001-2010 Neil Bowers Copyright (c) 2010-2018 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Changes000064400000061507152527153710006060 0ustar00Currently maintained by: Sullivan Beck (sbeck@cpan.org) Any suggestions, bug reports, or donations :-) should be sent to me. This document is automatically generated from the document: Locale::Codes::Changes and that document should be considered the canonical source of change related information. 3.57 2018-06-01 sbeck - NEW CODE(s) 3.56 2018-03-01 sbeck - NEW CODE(s) 3.55 2017-11-17 sbeck - NEW CODE(s) - (*) Deprecated in core Because correct usage of any of the Locale::Codes modules requires that they be kept up-to-date, I have long felt that it should not be distributed as a core module. After discussion on the perl5-porters list, it is agreed, and the deprecation process has been started. Starting with perl 5.28.0, Locale-Codes will be flagged as deprecated, and it will be removed in version 5.30.0 . Thanks to p5p-porters (especially Dagfinn Ilmari Mannsaker) for discussion and guidance. - Changes from a github pull request applied A couple minor changes (updated .travis.yml to include newest versions of perl; and a couple changes to pod_coverage.t) reported by lancew on GitHub. - Got rid of Build.PL Simplified things by only supporting one of Makefile.PL/Build.PL (and the latter has been removed from perl core some time ago). RT 123572 - Fixed INSTALLDIRS The behavior of installing core modules changed in 5.12 a bit, and Makefile.PL now reflects that. RT 123571 3.54 2017-09-01 sbeck - NEW CODE(s) 3.53 2017-07-25 sbeck - NEW CODE(s) - Fixed the default error condition in legacy modules. With the addition of the OO module, better error handling was added (and it was on by default). The non-OO (legacy) modules did not report errors, so code that uses them, would now behave differently if invalid data were passed in. I have turned off error handling by default in the legacy modules. The show_errors method was added to each of the non-OO modules to report errors if desired. Reported by dmaestro on GitHub. 3.52 2017-06-01 sbeck - NEW CODE(s) 3.51 2017-04-10 sbeck - NEW CODE(s) - Tests no longer require (.) in INC As of perl 5.25.11, (.) is being removed from INC. I had to adjust the tests accordingly. 3.50 2017-03-01 sbeck - NEW CODE(s) - (*) Rewrote as OO module The core module (Locale::Codes) is now an OO module that can be used directly. All of the other modules (Locale::Codes::TYPE) are still the older functional interfaces and remain unchanged. - Added some constants Historically, the constant names used to identify the codesets have been named inconsistently. The original constants for codesets are: Type Constants country LOCALE_CODE_* currency LOCALE_CURR_* language LOCALE_LANG_* script LOCALE_SCRIPT_* langfam LOCALE_LANGFAM_* langvar LOCALE_LANGVAR_* langext LOCALE_LANGEXT_* For consistencies sake, I have added some new codes (which are otherwise identical to the irregularly named codes): country LOCALE_COUNTRY_* currency LOCALE_CURRENCY_* language LOCALE_LANGUAGE_* Going forward, all constants will include the full name of the code type. - Non-OO modules are now generated All non-OO modules are now automatically generated. This will make it easier to keep them 100% consistent as well as making it easier to add new types of code sets. All of the documentation for them is also generated except for the description of the code sets. That has been moved into the Locale::Codes::Types document. - Fixed a bug where constants were not exported Some of the constants for some of the newer code sets were not exported properly. This was fixed when I started generating the non-OO modules, but was reported (after I had already fixed it in development) as RT 119741 . 3.42 2016-11-30 sbeck - Added Czech republic aliases back in Common Czech republic aliases disappeared from the standards, so I added them back in. Rob Emery 3.41 2016-11-18 sbeck - NEW CODE(s) Jiri Bohac noted that they were needed so this was release a couple weeks earlier than planned. 3.40 2016-09-01 sbeck - NEW CODE(s) 3.39 2016-05-31 sbeck - Added UN codes back in The UN codes have been added back in as their own list of codes. Jarkko Hietaniemi - Added GENC codes The GENC codes have been added. These are the new US Government codes that replace the FIPS-10 codes. They are based on, but not identical to the ISO 3166 codes. 3.38 2016-03-02 sbeck - NEW CODE(s) - Tests reworked Improved test suite (and made some changes to Codes.pm) based on Devel::Cover. Test suite now has 100% coverage. 3.37 2015-12-01 sbeck - NEW CODE(s) 3.36 2015-09-01 sbeck - NEW CODE(s) - (!) Removed alias_code function The alias_code function was preserved for backward compatibility, but has been deprecated since 3.20. It has been removed. 3.35 2015-06-01 sbeck - NEW CODE(s) - Documentation improvements Many changes to the formatting in the documentation to improve it. Suggested by Pete Houston. 3.34 2015-03-01 sbeck - NEW CODE(s) 3.33 2014-12-01 sbeck - NEW CODE(s) - Filled out LOCALE_LANG_TERM codeset The terminologic language codes only included codes from languages where the ISO specified both a bibliographic code and a terminologic code. If both are not specified, the better solution was to use the code for both code sets. Prompted by a suggestion by Jarkko Hietaniemi. - Moved repository to GitHub Suggested by Gabor Szabo. 3.32 2014-09-01 sbeck - NEW CODE(s) 3.31 2014-06-01 sbeck - NEW CODE(s) - Bug fixes Fixed a bug in the scripts used to extract data from spreadsheets that prevented the SHP currency code from being found. RT 94229 3.30 2014-03-04 sbeck - NEW CODE(s) - alias_code remove date set The alias_code function exists for backward compatibility. It has been deprecated since version 3.20 when it was replaced by rename_country_code. The alias_code function will be removed in the December 2014 release. - Bug fixes Fixed a problem that was preventing rename_* functions to not work. RT 92680. 3.29 2014-01-27 sbeck - NEW CODE(s) - ISO 3166 country codes improved ISO 3166 is now browsable online (previously, only the alpha-2 codes were) and it contains more accurate information than the previous sources, so I've switched to using the full standard. In response to RT 92303 which reported some codes being 'retired' that should not have been. - Bug fixes Fixed the pod test files so that pod tests won't get run at install time. In response to RT 91167. 3.28 2013-12-02 sbeck - NEW CODE(s) 3.27 2013-09-03 sbeck - NEW CODE(s) - * FIPS-10 country codes removed As of June, the FIPS codes are not being published in their entirety. Only changes to the codes are published. This adds a huge layer of complexity to maintaining the set, which is not worth doing considering that the set is deprecated. As such, the code set is no longer supported. 3.26 2013-06-03 sbeck - Documentation fixes Some of the examples were not correct. RT 84589 Some typos corrected. RT 85692 3.25 2013-03-01 sbeck - NEW CODE(s) 3.24 2012-12-03 sbeck - NEW CODE(s) - Syria alias Syria added as an alias. RT 82747 - FIPS-10 country codes deprecated The FIPS-10 document is being withdrawn. It was deprecated in 2008, and is being updated now only until all the agencies that use it have switched to something else. The current version no longer lists the long names for countries. These long names (such as 'Republic of Albania' for Albania) only appeared in the old FIPS-10 document which is no longer available, so they are no longer available in this module. I will continue to support the FIPS-10 codeset as long as it is available, but at that point, it will be withdrawn immediately. If an official end-of-life date is announced, I will include a notice here. Otherwise, support for the codeset will be discontinued when the document is withdrawn. You are encouraged to no longer use the FIPS-10 codeset. - Domain country codes now come from ISO 3166 The IANA domain codes have changed slightly. The IANA no longer publishes a list of countries associated with their codes. Instead, they use the ISO 3166 codes and country names. However, they support a few non-standard codes, so I will continue to maintain this codeset. The domain codes are now lowercase to correspond to the ISO 3166 codes. 3.23 2012-09-01 sbeck - NEW CODE(s) 3.22 2012-06-01 sbeck - NEW CODE(s) - Updated perl version required Changed 'require 5.002' (which dated back to the version 2.xx Locale-Codes) to 'require 5.006'. Some features used in Locale-Codes are not supported that far back. Nicholas Clark - Sorted deprecated codes The codes in the generated deprecated codes modules were not sorted making version diffs bigger than they should be. Nicholas Clark 3.21 2012-03-01 sbeck - NEW CODE(s) 3.20 2011-12-01 sbeck - NEW CODE(s) - Added limited support for deprecated codes The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions now support retired codes. RT 71124 - Fixed capitalization The 'South Sudan' country was all caps. RT 71024 - Pod tests off by default The pod tests will not run at install time. RT 71122 - Codesets may be specified by name All codesets may be specified by a constant or by their name now. Previously, they were specified only by a constant. - alias_code deprecated The alias_code function exists for backward compatibility. It has been replaced by rename_country_code . The alias_code function will be removed sometime after September, 2013 . - Code cleanup All work is now done in the central module (Locale::Codes). Previously, some was still done in the wrapper modules (Locale::Codes::*) but that is gone now. - Added LangFam module Added Language Family codes (langfam) as defined in ISO 639-5. 3.18 2011-08-31 sbeck - NEW CODE(s) - No longer use CIA data The CIA world added non-standard values, so I no longer use it as a source of data. Based on a report by Michiel Beijen. 3.17 2011-06-28 sbeck - NEW CODE(s) - Added new types of codes Added Language Extension codes (langext) and Language Variation codes (langvar) as defined in the IANA language registry. - Added new codeset(s) Added language codes from ISO 639-5 Added language/script codes from the IANA language subtag registry - Bug fixes Fixed an uninitialized value warning. RT 67438 Fixed the return value for the all_XXX_codes and all_XXX_names functions. RT 69100 - Reorganized code Reorganized modules to move Locale::MODULE to Locale::Codes::MODULE to allow for cleaner future additions. The original four modules (Locale::Language, Locale::Currency, Locale::Country, Locale::Script) will continue to work, but all new sets of codes will be added in the Locale::Codes namespace. 3.16 2011-03-01 sbeck - NEW CODE(s) 3.15 2010-12-02 sbeck - NEW CODE(s) - Minor fixes Added version number to Makefile.PL/Build.PL requirement for POD testing modules. RT 62247 Changed 'use vars' to 'our' 3.14 2010-09-28 sbeck - NEW CODE(s) - Bug fixes Stripped out some HTML that got included with some codes. 3.13 2010-06-04 sbeck - NEW CODE(s) 3.12 2010-04-06 sbeck - NEW CODE(s) - Reorganized code Renamed test.pl to testfunc.pl to avoid causing an error when built as part of perl. 3.11 2010-03-01 sbeck - NEW CODE(s) - Added new codeset(s) Added the IANA domain names to Country - Bug fixes Fixed a problem that produced warnings with perl 5.11.5. Jerry D. Hedden 3.10 2010-02-18 sbeck - NEW CODE(s) - Reorganized code Moved support files into the Locale::Codes namespace. The work done in each of the Locale::XXX modules was virtually identical to each other. It has all been moved to a central module and the Locale::XXX modules are now just wrappers. - (!) Changed XXX_code2code behavior slightly In previous versions, passing in the same code set for both code set arguments would automatically return undef. For example: country_code2code('bo',LOCALE_CODE_ALPHA_2,LOCALE_CODE_ALPHA_2); => undef This doesn't seem like reasonable behavior, so it has been changed to allow the same code set: country_code2code('bo',LOCALE_CODE_ALPHA_2,LOCALE_CODE_ALPHA_2); => 'bo' Note that if an invalid code is passed in, undef will still be returned: country_code2code('bol',LOCALE_CODE_ALPHA_2,LOCALE_CODE_ALPHA_2); => undef - Added many semi-private routines Previous versions had only two semi-private routines: rename_country and alias_code which had the ability to modify the internal data in a couple very limited ways. It was requested (in an anonymous posting by someone named Steve and also by Steve Hay) that better support for modifying internal data, so a full set of routines were added. The full set of routines includes: rename_country rename_language rename_currency rename_script add_country add_language add_currency add_script delete_country delete_language delete_currency delete_script add_country_alias add_language_alias add_currency_alias add_script_alias delete_country_alias delete_language_alias delete_currency_alias delete_script_alias rename_country_code rename_language_code rename_currency_code rename_script_code add_country_code_alias add_language_code_alias add_currency_code_alias add_script_code_alias delete_country_code_alias delete_language_code_alias delete_currency_code_alias delete_script_code_alias - New aliases Added "UK" alias. Steve Hay 3.01 2010-02-15 sbeck - Fixed Makefile.PL and Build.PL They now install as core modules as they are supposed to. Reported in RT 54526 3.00 2010-02-10 sbeck - NEW CODE(s) - (*) New maintainer From 1997 to 2004, Locale::Codes was maintained by Neil Bowers. Unfortunately, no updates were made from June 2004 to January 2010. During that time, a number of changes have been made to the standards since then, so the data included was out-of-date. I contacted Neil to get his permission to assume maintenance of the module, and he kindly agreed. - (*) (!) All codes are generated from standards All of the values returned by the various functions are now values directly from the standards. This means that the values returned in the 2.xx series are not necessarily the same as the values returned here. As an example, the ISO 3166 standard which lists country codes refers to the country associated with the code "bo" as "Bolivia, Plurinational State of", so that is what is returned. In the 2.xx series, "Bolivia" was returned. Also, the country names vary from one standard to another. So the code "bol" which is maintained by the United Nations returns the name of the country as "Bolivia (Plurinational State of)". Some common aliases have been added, so you can still request a code associated with a county name "Bolivia". Since the data comes from the standards, some "incorrect" values are no longer supported. For example, 2.07 treated "Zaire" as an alias for "Congo", but the country changed it's name, and "Zaire" is not in the standard, so it has been dropped in 3.00. - Added new codeset(s) FIPS 10 country codes (requested in RT 1755) Alpha-3 and Term language codes (requested in RT 11730) Numeric currency codes (requested in RT 18797) - (*) (!) Locale::Script changed In 2.xx, Locale::Script assigned scripts to country codes, which is NOT how it is done currently in the standards. It appears that an older version of ISO 15924 did this, but I haven't found an old version to confirm that, and in any case, that is not the case in the current standards. As a result, the Locale::Script module is completely incompatible with the 2.xx version with respect to the types of codes it supports. None of the old codes will work. - Added missing functions I've added in some functions which were "missing" previously (since there was only one set of codes supported, the code2code functions didn't apply): language_code2code currency_code2code so the interfaces for each type of codes are consistent. - (!) Dropped support for _alias_code In Locale::Country, _alias_code was an allowed, but deprecated function which was documented to be supported in the 2.xx series. I've removed it. - (!) All functions return the standard value code2country (and other equivalent functions) now returns the name of the country specified in the standard (if the different standards refer to the country by different variations in the name, the results will differ based on the CODESET) - (!) rename_country function altered The rename_country function from 2.07 would guess the CODESET (unlike all other functions which used a default of LOCALE_CODE_ALPHA_2). The guess can cause problems since (with the addition of FIPS) codes may appear in different codesets for different countries. The behavior has been changed to be the same as other functions (default to LOCALE_CODE_ALPHA_2). 2.07 2004-06-10 neilb Made $_ local in the initialization code for each module change back-propagated from Perl distribution Removed two non ISO-8859-1 characters from language names change back-propagated from Perl distribution Added the following aliases, with a test case for each - Burma added to Myanmar - French Southern and Antarctic Lands to French Southern Territories patch from TJ Mather "Canadian Dollar" was misspelled as "Candian Dollar" - noted by Nick Cabatoff, patch from Michael Hennecke Changes to Locale::Country reflecting changes in ISO 3166 - added Aland Islands (ax, ala, 248) - YUGOSLAVIA is now SERBIA AND MONTENEGRO YU => CS YUG => SCG 891 => 891 (unchanged) (YUGOSLAVIA retained as an alias) - EAST TIMOR changed to TIMOR-LESTE (old name retained as an alias) - three letter code for Romania changed from ROM to ROU ZAIRE is now CONGO, THE DEMOCRATIC REPUBLIC OF THE ZR => CD ZAR => COD 180 => 180 (unchanged) (ZAIRE retained as alias) 2.06 2002-07-15 neilb The four modules which have data after __DATA__ weren't closing the DATA filehandle after reading from it, which they should. Bug and patch from Steve Hay. 2.05 2002-07-08 neilb Added three letter codes for the countries that were missing them. Patch from TJ Mather. Documentation bug: one of the examples used => where the lvalue was a constant, which isn't allowed, unless you put the () with the constant to force the right interpretation. Pointed out by TJ Mather and MYT. Updated the URL for the appendix in the CIA world factbook. Patch from TJ Mather. 2.04 2002-05-23 neilb Updated according to changes in ISO 3166-1 described in ISO 3166-1 newsletters V-4 and V-5, dated 2002-05-20: - Kazakstan is now "Kazakhstan" - Macau is now "Macao" The old names are retained as aliases. The alpha-2 and alpha-3 codes for East Timor have changed: tp -> tl tmp -> tls the numeric code stays 626. If you want to support the old codes, you can use the semi-private function alias_code(). 2.03 2002-03-24 neilb Fixed a typo in the alias for the Vatican, reported (with patch) by Philip Newton. Added "Moldova" as an alias for "Moldova, Republic of" Updated Makefile.PL to include AUTHOR and ABSTRACT 2.02 2002-03-09 neilb Added semi-private routine rename_country() to Locale::Country, based on a patch from Iain Chalmers. Added test rename.t for the above function. Renamed _alias_code to be alias_code. Have retained the old name for backwards compatibility. Will remove it when the major version number next changes. 2.01 2002-02-18 neilb Split the documentation for all modules into separate pod files. Made sure all =over were =over 4; some were other values. The code2code() methods had one more shift than was needed. 2.00 2002-02-17 neilb Created Locale::Script which provides an interface to the ISO codes for identification of scripts (writing scripts, rather than perl style scripts). The codes are defined by ISO 15924, which is currently in final draft. Thanks to Jarkko for pointing out this new standard. All three code sets are supported, and a test-suite added. Added support for country name variants to Locale::Country, so that country2code('USA') country2code('United States') country2code('United States of America') will all return 'us'. This had been in the LIMITATIONS section since the first version. Patch from TJ Mather with additional variants from me. Added test-cases for these. Added VERSION to Locale::Constants. Thanks to Jarkko for pointing that it was missing. Should really have bumped major version with previous release, since there was a change to the API. 1.06 2001-03-04 neilb Added Locale::Constants, which defines three symbols for identifying which codeset is being used: LOCALE_CODE_ALPHA_2 LOCALE_CODE_ALPHA_3 LOCALE_CODE_NUMERIC Updated Locale::Country to support all three code sets defined by ISO 3166. This was requested by Keith Wall. I haven't added multiple codeset support to the other modules yet - I'll wait until someone asks for them. 1.05 2001-02-13 neilb Added Locale::Currency, contribution from Michael Hennecke. Added test suite for it (t/currency.t) and added test cases to t/all.t for the all_* functions. 1.04 2000-12-21 neilb Fixed very minor typos from 1.03! 1.03 2000-12-?? neilb Updated Locale::Country: - fixed spelling of a few countries - added link to a relevant page from CIA world factbook Updated Locale::Language: - fixed typo in the documentation (ISO 939 should be 639) 1.02 2000-05-04 neilb Updated Locale::Country and Locale::Language to reflect changes in the relevant ISO standards. These mainly reflect languages which are new to the relevant standard, and changes in the spelling of some country names. Added official URLs for the standards to the SEE ALSO sections of the doc for each module. Thanks to Jarkko Hietaniemi for pointing me at the pages with latest versions of ISO 3166 and 639. 1.00 1998-03-09 neilb Added Locale::Country::_alias_code() so that 'uk' can be added as the code for "United Kingdom", if you want it. This was prompted by Ed Jordan. Added a new test suite for handling this case, and extended the existing test-suite to include testing of the case where 'uk' hasn't been defined as a valid code. 0.003 1997-05-09 neilb First public release to CPAN