1Locale::Codes::Changes(U3s)er Contributed Perl DocumentatLioocnale::Codes::Changes(3)
2
3
4
6 Locale::Codes::Changes - details changes to Locale::Codes
7
9 This describes the changes made to modules in the Locale-Codes
10 distribution. Major changes are marked with asterisks (*). For the
11 most part, all modules have remained backward compatible at every
12 release, but occasionally a change is made which is backward
13 incompatible. These are marked with an exclamation mark (!).
14
15 As of 3.00, the codes are autogenerated from the standards. With each
16 release, codes will be re-generated and tested to see if any code
17 changed. Any time there are any changes to the codes, it will be
18 flagged below with a change: NEW CODE(s).
19
20 I intend to check for new codes four times a year (March, June,
21 September, December). I will also try to respond to requests for a
22 release due to changes made to the standards, so if a code changes that
23 you use, feel free to contact me. Based on my available time and the
24 time until the next release is scheduled, I will try to do a release
25 any time the standards change.
26
28 NEW CODE(s)
29
31 NEW CODE(s)
32
34 NEW CODE(s)
35
37 NEW CODE(s)
38 Fixed bug deleting retired codes
39 The delete_code function failed if you tried to delete a retired
40 code. This is now fixed. GitHub #12
41
43 NEW CODE(s)
44 NOTE: no code changes on 2019-12-01 so no release made at that
45 time.
46
47 Fixed a retired code
48
50 NEW CODE(s)
51 Fixed tests
52 Tests were not working correctly since the previous version. This
53 is now fixed.
54
55 Fixed error messages
56 Many of the error messages were inconsistent or completely wrong
57 (due to cut-and-paste errors). They have been fixed.
58
59 Fixed some return codes
60 The name2code and code2name functions returned 1 in the case of an
61 error in some situations instead of undef (which was the documented
62 value).
63
64 Removed unnecessary dependencies
65 A number of modules were included as test dependencies that are
66 only used by the author when preparing releases. These have been
67 removed as dependencies. Petr Pisar on GitHub #11
68
70 NEW CODE(s)
71 Converted tests to use Test::Inter
72 Now uses the same module to do tests as all my other modules.
73
75 NEW CODE(s)
76
78 NEW CODE(s)
79 Removed travis file from the tarball
80 The tarball had a .travis.yml file in it that wasn't in the
81 MANIFEST file. Since the MANIFEST file is automatically generated
82 by the perl mkmanifest tool, since it didn't see the .travis.yml
83 file, I have excluded it from the tarball. Reported by Mohammad S
84 Anwar on GitHub (#10)
85
87 NEW CODE(s)
88 (*) Locale-Codes removed from core
89 Locale-Codes will no longer be distributed in new versions of perl.
90
91 Documentation fix
92 Fixed an incorrect link reported by Mohammad S Anwar on GitHub (#9)
93
95 NEW CODE(s)
96
98 NEW CODE(s)
99
101 NEW CODE(s)
102 (*) Deprecated in core
103 Because correct usage of any of the Locale::Codes modules requires
104 that they be kept up-to-date, I have long felt that it should not
105 be distributed as a core module. After discussion on the
106 perl5-porters list, it is agreed, and the deprecation process has
107 been started. Starting with perl 5.28.0, Locale-Codes will be
108 flagged as deprecated, and it will be removed in version 5.30.0 .
109
110 Thanks to p5p-porters (especially Dagfinn Ilmari Mannsaker) for
111 discussion and guidance.
112
113 Changes from a github pull request applied
114 A couple minor changes (updated .travis.yml to include newest
115 versions of perl; and a couple changes to pod_coverage.t) reported
116 by lancew on GitHub.
117
118 Got rid of Build.PL
119 Simplified things by only supporting one of Makefile.PL/Build.PL
120 (and the latter has been removed from perl core some time ago). RT
121 123572
122
123 Fixed INSTALLDIRS
124 The behavior of installing core modules changed in 5.12 a bit, and
125 Makefile.PL now reflects that. RT 123571
126
128 NEW CODE(s)
129
131 NEW CODE(s)
132 Fixed the default error condition in legacy modules.
133 With the addition of the OO module, better error handling was added
134 (and it was on by default). The non-OO (legacy) modules did not
135 report errors, so code that uses them, would now behave differently
136 if invalid data were passed in.
137
138 I have turned off error handling by default in the legacy modules.
139 The show_errors method was added to each of the non-OO modules to
140 report errors if desired.
141
142 Reported by dmaestro on GitHub.
143
145 NEW CODE(s)
146
148 NEW CODE(s)
149 Tests no longer require (.) in INC
150 As of perl 5.25.11, (.) is being removed from INC. I had to adjust
151 the tests accordingly.
152
154 NEW CODE(s)
155 (*) Rewrote as OO module
156 The core module (Locale::Codes) is now an OO module that can be
157 used directly. All of the other modules (Locale::Codes::TYPE) are
158 still the older functional interfaces and remain unchanged.
159
160 Added some constants
161 Historically, the constant names used to identify the codesets have
162 been named inconsistently. The original constants for codesets
163 are:
164
165 Type Constants
166
167 country LOCALE_CODE_*
168 currency LOCALE_CURR_*
169 language LOCALE_LANG_*
170
171 script LOCALE_SCRIPT_*
172 langfam LOCALE_LANGFAM_*
173 langvar LOCALE_LANGVAR_*
174 langext LOCALE_LANGEXT_*
175
176 For consistencies sake, I have added some new codes (which are
177 otherwise identical to the irregularly named codes):
178
179 country LOCALE_COUNTRY_*
180 currency LOCALE_CURRENCY_*
181 language LOCALE_LANGUAGE_*
182
183 Going forward, all constants will include the full name of the code
184 type.
185
186 Non-OO modules are now generated
187 All non-OO modules are now automatically generated. This will make
188 it easier to keep them 100% consistent as well as making it easier
189 to add new types of code sets.
190
191 All of the documentation for them is also generated except for the
192 description of the code sets. That has been moved into the
193 Locale::Codes::Types document.
194
195 Fixed a bug where constants were not exported
196 Some of the constants for some of the newer code sets were not
197 exported properly. This was fixed when I started generating the
198 non-OO modules, but was reported (after I had already fixed it in
199 development) as RT 119741 .
200
202 Added Czech republic aliases back in
203 Common Czech republic aliases disappeared from the standards, so I
204 added them back in. Rob Emery
205
207 NEW CODE(s)
208 Jiri Bohac noted that they were needed so this was release a couple
209 weeks earlier than planned.
210
212 NEW CODE(s)
213
215 Added UN codes back in
216 The UN codes have been added back in as their own list of codes.
217 Jarkko Hietaniemi
218
219 Added GENC codes
220 The GENC codes have been added. These are the new US Government
221 codes that replace the FIPS-10 codes. They are based on, but not
222 identical to the ISO 3166 codes.
223
225 NEW CODE(s)
226 Tests reworked
227 Improved test suite (and made some changes to Codes.pm) based on
228 Devel::Cover. Test suite now has 100% coverage.
229
231 NEW CODE(s)
232
234 NEW CODE(s)
235 (!) Removed alias_code function
236 The alias_code function was preserved for backward compatibility,
237 but has been deprecated since 3.20. It has been removed.
238
240 NEW CODE(s)
241 Documentation improvements
242 Many changes to the formatting in the documentation to improve it.
243 Suggested by Pete Houston.
244
246 NEW CODE(s)
247
249 NEW CODE(s)
250 Filled out LOCALE_LANG_TERM codeset
251 The terminologic language codes only included codes from languages
252 where the ISO specified both a bibliographic code and a
253 terminologic code. If both are not specified, the better solution
254 was to use the code for both code sets. Prompted by a suggestion
255 by Jarkko Hietaniemi.
256
257 Moved repository to GitHub
258 Suggested by Gabor Szabo.
259
261 NEW CODE(s)
262
264 NEW CODE(s)
265 Bug fixes
266 Fixed a bug in the scripts used to extract data from spreadsheets
267 that prevented the SHP currency code from being found. RT 94229
268
270 NEW CODE(s)
271 alias_code remove date set
272 The alias_code function exists for backward compatibility. It has
273 been deprecated since version 3.20 when it was replaced by
274 rename_country_code. The alias_code function will be removed in
275 the December 2014 release.
276
277 Bug fixes
278 Fixed a problem that was preventing rename_* functions to not work.
279 RT 92680.
280
282 NEW CODE(s)
283 ISO 3166 country codes improved
284 ISO 3166 is now browsable online (previously, only the alpha-2
285 codes were) and it contains more accurate information than the
286 previous sources, so I've switched to using the full standard. In
287 response to RT 92303 which reported some codes being 'retired' that
288 should not have been.
289
290 Bug fixes
291 Fixed the pod test files so that pod tests won't get run at install
292 time. In response to RT 91167.
293
295 NEW CODE(s)
296
298 NEW CODE(s)
299 * FIPS-10 country codes removed
300 As of June, the FIPS codes are not being published in their
301 entirety. Only changes to the codes are published. This adds a
302 huge layer of complexity to maintaining the set, which is not worth
303 doing considering that the set is deprecated. As such, the code
304 set is no longer supported.
305
307 Documentation fixes
308 Some of the examples were not correct. RT 84589
309
310 Some typos corrected. RT 85692
311
313 NEW CODE(s)
314
316 NEW CODE(s)
317 Syria alias
318 Syria added as an alias. RT 82747
319
320 FIPS-10 country codes deprecated
321 The FIPS-10 document is being withdrawn. It was deprecated in
322 2008, and is being updated now only until all the agencies that use
323 it have switched to something else. The current version no longer
324 lists the long names for countries. These long names (such as
325 'Republic of Albania' for Albania) only appeared in the old FIPS-10
326 document which is no longer available, so they are no longer
327 available in this module.
328
329 I will continue to support the FIPS-10 codeset as long as it is
330 available, but at that point, it will be withdrawn immediately. If
331 an official end-of-life date is announced, I will include a notice
332 here. Otherwise, support for the codeset will be discontinued when
333 the document is withdrawn.
334
335 You are encouraged to no longer use the FIPS-10 codeset.
336
337 Domain country codes now come from ISO 3166
338 The IANA domain codes have changed slightly. The IANA no longer
339 publishes a list of countries associated with their codes.
340 Instead, they use the ISO 3166 codes and country names. However,
341 they support a few non-standard codes, so I will continue to
342 maintain this codeset. The domain codes are now lowercase to
343 correspond to the ISO 3166 codes.
344
346 NEW CODE(s)
347
349 NEW CODE(s)
350 Updated perl version required
351 Changed 'require 5.002' (which dated back to the version 2.xx
352 Locale-Codes) to 'require 5.006'. Some features used in Locale-
353 Codes are not supported that far back. Nicholas Clark
354
355 Sorted deprecated codes
356 The codes in the generated deprecated codes modules were not sorted
357 making version diffs bigger than they should be. Nicholas Clark
358
360 NEW CODE(s)
361
363 NEW CODE(s)
364 Added limited support for deprecated codes
365 The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions
366 now support retired codes. RT 71124
367
368 Fixed capitalization
369 The 'South Sudan' country was all caps. RT 71024
370
371 Pod tests off by default
372 The pod tests will not run at install time. RT 71122
373
374 Codesets may be specified by name
375 All codesets may be specified by a constant or by their name now.
376 Previously, they were specified only by a constant.
377
378 alias_code deprecated
379 The alias_code function exists for backward compatibility. It has
380 been replaced by rename_country_code . The alias_code function
381 will be removed sometime after September, 2013 .
382
383 Code cleanup
384 All work is now done in the central module (Locale::Codes).
385 Previously, some was still done in the wrapper modules
386 (Locale::Codes::*) but that is gone now.
387
388 Added LangFam module
389 Added Language Family codes (langfam) as defined in ISO 639-5.
390
392 NEW CODE(s)
393 No longer use CIA data
394 The CIA world added non-standard values, so I no longer use it as a
395 source of data. Based on a report by Michiel Beijen.
396
398 NEW CODE(s)
399 Added new types of codes
400 Added Language Extension codes (langext) and Language Variation
401 codes (langvar) as defined in the IANA language registry.
402
403 Added new codeset(s)
404 Added language codes from ISO 639-5
405
406 Added language/script codes from the IANA language subtag registry
407
408 Bug fixes
409 Fixed an uninitialized value warning. RT 67438
410
411 Fixed the return value for the all_XXX_codes and all_XXX_names
412 functions. RT 69100
413
414 Reorganized code
415 Reorganized modules to move Locale::MODULE to Locale::Codes::MODULE
416 to allow for cleaner future additions. The original four modules
417 (Locale::Language, Locale::Currency, Locale::Country,
418 Locale::Script) will continue to work, but all new sets of codes
419 will be added in the Locale::Codes namespace.
420
422 NEW CODE(s)
423
425 NEW CODE(s)
426 Minor fixes
427 Added version number to Makefile.PL/Build.PL requirement for POD
428 testing modules. RT 62247
429
430 Changed 'use vars' to 'our'
431
433 NEW CODE(s)
434 Bug fixes
435 Stripped out some HTML that got included with some codes.
436
438 NEW CODE(s)
439
441 NEW CODE(s)
442 Reorganized code
443 Renamed test.pl to testfunc.pl to avoid causing an error when built
444 as part of perl.
445
447 NEW CODE(s)
448 Added new codeset(s)
449 Added the IANA domain names to Country
450
451 Bug fixes
452 Fixed a problem that produced warnings with perl 5.11.5. Jerry D.
453 Hedden
454
456 NEW CODE(s)
457 Reorganized code
458 Moved support files into the Locale::Codes namespace.
459
460 The work done in each of the Locale::XXX modules was virtually
461 identical to each other. It has all been moved to a central module
462 and the Locale::XXX modules are now just wrappers.
463
464 (!) Changed XXX_code2code behavior slightly
465 In previous versions, passing in the same code set for both code
466 set arguments would automatically return undef. For example:
467
468 country_code2code('bo',LOCALE_CODE_ALPHA_2,LOCALE_CODE_ALPHA_2);
469 => undef
470
471 This doesn't seem like reasonable behavior, so it has been changed
472 to allow the same code set:
473
474 country_code2code('bo',LOCALE_CODE_ALPHA_2,LOCALE_CODE_ALPHA_2);
475 => 'bo'
476
477 Note that if an invalid code is passed in, undef will still be
478 returned:
479
480 country_code2code('bol',LOCALE_CODE_ALPHA_2,LOCALE_CODE_ALPHA_2);
481 => undef
482
483 Added many semi-private routines
484 Previous versions had only two semi-private routines:
485 rename_country and alias_code which had the ability to modify the
486 internal data in a couple of very limited ways. It was requested
487 (in an anonymous posting by someone named Steve and also by Steve
488 Hay) that better support for modifying internal data, so a full set
489 of routines were added.
490
491 The full set of routines includes:
492
493 rename_country
494 rename_language
495 rename_currency
496 rename_script
497
498 add_country
499 add_language
500 add_currency
501 add_script
502
503 delete_country
504 delete_language
505 delete_currency
506 delete_script
507
508 add_country_alias
509 add_language_alias
510 add_currency_alias
511 add_script_alias
512
513 delete_country_alias
514 delete_language_alias
515 delete_currency_alias
516 delete_script_alias
517
518 rename_country_code
519 rename_language_code
520 rename_currency_code
521 rename_script_code
522
523 add_country_code_alias
524 add_language_code_alias
525 add_currency_code_alias
526 add_script_code_alias
527
528 delete_country_code_alias
529 delete_language_code_alias
530 delete_currency_code_alias
531 delete_script_code_alias
532
533 New aliases
534 Added "UK" alias. Steve Hay
535
537 Fixed Makefile.PL and Build.PL
538 They now install as core modules as they are supposed to. Reported
539 in RT 54526
540
542 NEW CODE(s)
543 (*) New maintainer
544 From 1997 to 2004, Locale::Codes was maintained by Neil Bowers.
545 Unfortunately, no updates were made from June 2004 to January 2010.
546 During that time, a number of changes were made to the standards,
547 so the data included was out-of-date.
548
549 I contacted Neil to get his permission to assume maintenance of the
550 module, and he kindly agreed.
551
552 (*) (!) All codes are generated from standards
553 All of the values returned by the various functions are now values
554 directly from the standards. This means that the values returned in
555 the 2.xx series are not necessarily the same as the values returned
556 here.
557
558 As an example, the ISO 3166 standard which lists country codes
559 refers to the country associated with the code "bo" as "Bolivia,
560 Plurinational State of", so that is what is returned. In the 2.xx
561 series, "Bolivia" was returned. Also, the country names vary from
562 one standard to another. So the code "bol" which is maintained by
563 the United Nations returns the name of the country as "Bolivia
564 (Plurinational State of)". Some common aliases have been added, so
565 you can still request a code associated with a county name
566 "Bolivia".
567
568 Since the data comes from the standards, some "incorrect" values
569 are no longer supported. For example, 2.07 treated "Zaire" as an
570 alias for "Congo", but the country changed it's name, and "Zaire"
571 is not in the standard, so it has been dropped in 3.00.
572
573 Added new codeset(s)
574 FIPS 10 country codes (requested in RT 1755)
575
576 Alpha-3 and Term language codes (requested in RT 11730)
577
578 Numeric currency codes (requested in RT 18797)
579
580 (*) (!) Locale::Script changed
581 In 2.xx, Locale::Script assigned scripts to country codes, which is
582 NOT how it is done currently in the standards. It appears that an
583 older version of ISO 15924 did this, but I haven't found an old
584 version to confirm that, and in any case, that is not the case in
585 the current standards.
586
587 As a result, the Locale::Script module is completely incompatible
588 with the 2.xx version with respect to the types of codes it
589 supports. None of the old codes will work.
590
591 Added missing functions
592 I've added in some functions which were "missing" previously (since
593 there was only one set of codes supported, the code2code functions
594 didn't apply):
595
596 language_code2code
597 currency_code2code
598
599 so the interfaces for each type of codes are consistent.
600
601 (!) Dropped support for _alias_code
602 In Locale::Country, _alias_code was an allowed, but deprecated
603 function which was documented to be supported in the 2.xx series.
604 I've removed it.
605
606 (!) All functions return the standard value
607 code2country (and other equivalent functions) now returns the name
608 of the country specified in the standard (if the different
609 standards refer to the country by different variations in the name,
610 the results will differ based on the CODESET)
611
612 (!) rename_country function altered
613 The rename_country function from 2.07 would guess the CODESET
614 (unlike all other functions which used a default of
615 LOCALE_CODE_ALPHA_2). The guess can cause problems since (with the
616 addition of FIPS) codes may appear in different codesets for
617 different countries. The behavior has been changed to be the same
618 as other functions (default to LOCALE_CODE_ALPHA_2).
619
621 Made $_ local in the initialization code for each module change
622 back-propagated from Perl distribution
623
624 Removed two non ISO-8859-1 characters from language names change
625 back-propagated from Perl distribution
626
627 Added the following aliases, with a test case for each
628 - Burma added to Myanmar
629 - French Southern and Antarctic Lands to
630 French Southern Territories patch from TJ Mather
631
632 "Canadian Dollar" was misspelled as "Candian Dollar"
633 - noted by Nick Cabatoff, patch from Michael Hennecke
634
635 Changes to Locale::Country reflecting changes in ISO 3166
636 - added Aland Islands (ax, ala, 248)
637 - YUGOSLAVIA is now SERBIA AND MONTENEGRO
638 YU => CS
639 YUG => SCG
640 891 => 891 (unchanged)
641 (YUGOSLAVIA retained as an alias)
642 - EAST TIMOR changed to TIMOR-LESTE
643 (old name retained as an alias)
644 - three letter code for Romania changed from ROM to ROU
645
646 ZAIRE is now CONGO, THE DEMOCRATIC REPUBLIC OF THE
647 ZR => CD
648 ZAR => COD
649 180 => 180 (unchanged)
650 (ZAIRE retained as alias)
651
653 The four modules which have data after __DATA__ weren't closing the
654 DATA filehandle after reading from it, which they should. Bug and
655 patch from Steve Hay.
656
658 Added three letter codes for the countries that were missing them.
659 Patch from TJ Mather.
660
661 Documentation bug: one of the examples used => where the lvalue was
662 a constant, which isn't allowed, unless you put the () with the
663 constant to force the right interpretation. Pointed out by TJ
664 Mather and MYT.
665
666 Updated the URL for the appendix in the CIA world factbook. Patch
667 from TJ Mather.
668
670 Updated according to changes in ISO 3166-1 described in ISO 3166-1
671 newsletters V-4 and V-5, dated 2002-05-20:
672 - Kazakstan is now "Kazakhstan"
673 - Macau is now "Macao" The old names are retained as aliases.
674
675 The alpha-2 and alpha-3 codes for East Timor have changed:
676 tp -> tl
677 tmp -> tls the numeric code stays 626. If you want to support
678 the old codes, you can use the semi-private function alias_code().
679
681 Fixed a typo in the alias for the Vatican, reported (with patch) by
682 Philip Newton.
683
684 Added "Moldova" as an alias for "Moldova, Republic of"
685
686 Updated Makefile.PL to include AUTHOR and ABSTRACT
687
689 Added semi-private routine rename_country() to Locale::Country,
690 based on a patch from Iain Chalmers.
691
692 Added test rename.t for the above function.
693
694 Renamed _alias_code to be alias_code. Have retained the old name
695 for backwards compatibility. Will remove it when the major version
696 number next changes.
697
699 Split the documentation for all modules into separate pod files.
700
701 Made sure all =over were =over 4; some were other values.
702
703 The code2code() methods had one more shift than was needed.
704
706 Created Locale::Script which provides an interface to the ISO codes
707 for identification of scripts (writing scripts, rather than perl
708 style scripts). The codes are defined by ISO 15924, which is
709 currently in final draft. Thanks to Jarkko for pointing out this
710 new standard. All three code sets are supported, and a test-suite
711 added.
712
713 Added support for country name variants to Locale::Country, so that
714 country2code('USA')
715 country2code('United States')
716 country2code('United States of America') will all return 'us'.
717 This had been in the LIMITATIONS section since the first version.
718 Patch from TJ Mather with additional variants from me. Added test-
719 cases for these.
720
721 Added VERSION to Locale::Constants. Thanks to Jarkko for pointing
722 that it was missing.
723
724 Should really have bumped major version with previous release,
725 since there was a change to the API.
726
728 Added Locale::Constants, which defines three symbols for
729 identifying which codeset is being used:
730
731 LOCALE_CODE_ALPHA_2
732 LOCALE_CODE_ALPHA_3
733 LOCALE_CODE_NUMERIC
734
735 Updated Locale::Country to support all three code sets defined by
736 ISO 3166. This was requested by Keith Wall. I haven't added
737 multiple codeset support to the other modules yet - I'll wait until
738 someone asks for them.
739
741 Added Locale::Currency, contribution from Michael Hennecke.
742
743 Added test suite for it (t/currency.t) and added test cases to
744 t/all.t for the all_* functions.
745
747 Fixed very minor typos from 1.03!
748
750 Updated Locale::Country:
751 - fixed spelling of a few countries
752 - added link to a relevant page from CIA world factbook
753
754 Updated Locale::Language:
755 - fixed typo in the documentation (ISO 939 should be 639)
756
758 Updated Locale::Country and Locale::Language to reflect changes in
759 the relevant ISO standards. These mainly reflect languages which
760 are new to the relevant standard, and changes in the spelling of
761 some country names.
762
763 Added official URLs for the standards to the SEE ALSO sections of
764 the doc for each module.
765
766 Thanks to Jarkko Hietaniemi for pointing me at the pages with
767 latest versions of ISO 3166 and 639.
768
770 Added Locale::Country::_alias_code() so that 'uk' can be added as
771 the code for "United Kingdom", if you want it. This was prompted
772 by Ed Jordan.
773
774 Added a new test suite for handling this case, and extended the
775 existing test-suite to include testing of the case where 'uk'
776 hasn't been defined as a valid code.
777
779 First public release to CPAN
780
782 Locale::Codes
783
785 See Locale::Codes for full author history.
786
787 Currently maintained by Sullivan Beck (sbeck@cpan.org).
788
790 Copyright (c) 2001-2010 Neil Bowers
791 Copyright (c) 2010-2021 Sullivan Beck
792
793 This module is free software; you can redistribute it and/or modify it
794 under the same terms as Perl itself.
795
796
797
798perl v5.32.1 2021-03-02 Locale::Codes::Changes(3)