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 check on request, so if a code changes
that you use, feel free to contact me. Any time there are new codes, I will
add them to the module and release a new version.

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.

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.

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
.

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.

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.

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.

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.

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.

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.

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.

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).

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().

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:

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.

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.