Locale::Codes::Changes - details changes to Locale::Codes
This describes the changes made to modules in the Locale-Codes distribution. Major changes are marked with asterisks (*). For the most part, all modules have remained backward compatible at every release, but occasionally a change is made which is backward incompatible. These are marked with an exclamation mark (!).
As of 3.00, the codes are autogenerated from the standards. With each release, codes will be re-generated and tested to see if any code changed. Any time there are any changes to the codes, it will be flagged below with a change: NEW CODE(s).
I intend to check for new codes four times a year (March, June, September, December). I will also try to respond to requests for a release due to changes made to the standards, so if a code changes that you use, feel free to contact me. Based on my available time and the time until the next release is scheduled, I will try to do a release any time the standards change.
NOTE: no code changes on 2021-06-01 so no release made at that time.
Also code2countrys, code2languages, etc. This allows you to see all names and aliases that correspond to a code. My apologies for making 'countrys' to be the plural of 'country', but because these modules are all generated from a template, I didn't want to put in an exception for the strange pluralization.
Prompted by David Cantrell.
The delete_code function failed if you tried to delete a retired code. This is now fixed. GitHub #12
NOTE: no code changes on 2019-12-01 so no release made at that time.
Tests were not working correctly since the previous version. This is now fixed.
Many of the error messages were inconsistent or completely wrong (due to cut-and-paste errors). They have been fixed.
The name2code and code2name functions returned 1 in the case of an error in some situations instead of undef (which was the documented value).
A number of modules were included as test dependencies that are only used by the author when preparing releases. These have been removed as dependencies. Petr Pisar on GitHub #11
Now uses the same module to do tests as all my other modules.
The tarball had a .travis.yml file in it that wasn't in the MANIFEST file. Since the MANIFEST file is automatically generated by the perl mkmanifest tool, since it didn't see the .travis.yml file, I have excluded it from the tarball. Reported by Mohammad S Anwar on GitHub (#10)
Locale-Codes will no longer be distributed in new versions of perl.
Fixed an incorrect link reported by Mohammad S Anwar on GitHub (#9)
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.
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.
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
The behavior of installing core modules changed in 5.12 a bit, and Makefile.PL now reflects that. RT 123571
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.
As of perl 5.25.11, (.) is being removed from INC. I had to adjust the tests accordingly.
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.
Historically, the constant names used to identify the codesets have been named inconsistently. The original constants for codesets are:
For consistencies sake, I have added some new codes (which are otherwise identical to the irregularly named codes):
Going forward, all constants will include the full name of the code type.
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.
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 .
Common Czech republic aliases disappeared from the standards, so I added them back in. Rob Emery
Jiri Bohac noted that they were needed so this was release a couple weeks earlier than planned.
The UN codes have been added back in as their own list of codes. Jarkko Hietaniemi
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.
Improved test suite (and made some changes to Codes.pm) based on Devel::Cover. Test suite now has 100% coverage.
The alias_code function was preserved for backward compatibility, but has been deprecated since 3.20. It has been removed.
Many changes to the formatting in the documentation to improve it. Suggested by Pete Houston.
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.
Suggested by Gabor Szabo.
Fixed a bug in the scripts used to extract data from spreadsheets that prevented the SHP currency code from being found. RT 94229
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.
Fixed a problem that was preventing rename_* functions to not work. RT 92680.
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.
Fixed the pod test files so that pod tests won't get run at install time. In response to RT 91167.
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.
Some of the examples were not correct. RT 84589
Some typos corrected. RT 85692
Syria added as an alias. RT 82747
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.
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.
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
The codes in the generated deprecated codes modules were not sorted making version diffs bigger than they should be. Nicholas Clark
The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions now support retired codes. RT 71124
The 'South Sudan' country was all caps. RT 71024
The pod tests will not run at install time. RT 71122
All codesets may be specified by a constant or by their name now. Previously, they were specified only by a constant.
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 .
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 Language Family codes (langfam) as defined in ISO 639-5.
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.
Added Language Extension codes (langext) and Language Variation codes (langvar) as defined in the IANA language registry.
Added language codes from ISO 639-5
Added language/script codes from the IANA language subtag registry
Fixed an uninitialized value warning. RT 67438
Fixed the return value for the all_XXX_codes and all_XXX_names functions. RT 69100
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.
Added version number to Makefile.PL/Build.PL requirement for POD testing modules. RT 62247
Changed 'use vars' to 'our'
Stripped out some HTML that got included with some codes.
Renamed test.pl to testfunc.pl to avoid causing an error when built as part of perl.
Added the IANA domain names to Country
Fixed a problem that produced warnings with perl 5.11.5. Jerry D. Hedden
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.
In previous versions, passing in the same code set for both code set arguments would automatically return undef. For example:
This doesn't seem like reasonable behavior, so it has been changed to allow the same code set:
Note that if an invalid code is passed in, undef will still be returned:
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 of very limited ways. It was requested (in an anonymous posting by someone named Steve and also by Steve Hay - unknown if they are the same person or two different Steves) that better support for modifying internal data, so a full set of routines were added.
The full set of routines includes:
Added "UK" alias. Steve Hay
They now install as core modules as they are supposed to. Reported in RT 54526
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 were made to the standards, 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 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.
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)
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.
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):
so the interfaces for each type of codes are consistent.
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.
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)
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).
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)
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.
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.
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().
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
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.
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.
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.
Added Locale::Constants, which defines three symbols for identifying which codeset is being used:
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.
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.
Fixed very minor typos from 1.03!
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)
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.
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.
First public release to CPAN
See Locale::Codes for full author history.
Currently maintained by Sullivan Beck (email@example.com).
Copyright (c) 2001-2010 Neil Bowers
Copyright (c) 2010-2022 Sullivan Beck
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Locale::Codes, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.