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