Skip Menu |

This queue is for tickets about the Locale-Codes CPAN distribution.

Report information
The Basics
Id: 71124
Status: resolved
Priority: 0/
Queue: Locale-Codes

People
Owner: Nobody in particular
Requestors: rjbs [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: is there a way to get names from deprecated country codes?
The ISO code "an" was only retired last year, and plenty of data still refers to it. code2country('an') finds nothing. Is there a way to use Locale::Codes to get this datum? -- rjbs
Unfortunately, when I generate the codes for Locale-Codes, I get them from the standards, and those standards contain current information, but not historical information. So the immediate answer is: no, this is not possible. However, I can see some good arguments for including this functionality. I'll have to give it some thought... if it can be implemented in a way that doesn't involve a complete rewrite, I'll add it. Just a note though... I doubt I'll have time to implement it in the next few months, so I wouldn't expect to see it for 5-6 months.
After some thought, I realized that this would actually be a fairly easy thing to add... and a useful addition, so I've added it. It will be in the next release. Support for deprecated codes is somewhat limited... but the most important functions (code2XXX, XXX2code, all_XXX_codes, and all_XXX_names support deprecated codes now). Also it should be noted that by deprecated codes, I only mean codes that have, at one time or another, been in Locale::Codes. Any code that came and went but never made it into Locale::Codes is not included.
I can't find it documented how to get at these. The tests are somewhat difficult to read, as they seem written in the little language of testfunc.pl code2code, also, doesn't *seem* to allow me to pass in retired, but I'm not sure. -- rjbs
If you read the Locale::Codes::API manual, deprecated codes are documented. You can do something like: all_country_codes('alpha-2','retired') to get all country codes (active AND retired). Check out the other functions which take the optional 'retired' argument for more functionality.
On 2014-01-21 09:51:26, SBECK wrote: Show quoted text
> If you read the Locale::Codes::API manual, deprecated codes are > documented.
Thanks, I had not seen Locale::Codes::API! Silly me. -- rjbs