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