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