in reply to Validate Country by ISO 3166 data

Nice mod. One problem I see is that some of the countries have diacritics in the name, for example, you have
"reunion" => "RE Reunion",
when it should be
"réunion" => "RE Réunion",
But there is another problem and that is to change the case of the country name to match against the hash involves a change of case. This change of case like using the uc() function or lc() will not handle the diacritics correctly. You can subtract an ascii 32, and catch most of these, but not all. Another option is to go with the
use utf8;
But this has some weirdnesses as well. Very useful module, I think it may need to be tweaked a little to handle the weird cases where diacritics appear in the country name.

cheers!
krazken

Replies are listed 'Best First'.
Re: Re: Validate Country by ISO 3166 data
by shotgunefx (Parson) on Mar 08, 2002 at 20:25 UTC
    Thanks for the feedback. I've changed the module to get the values from Locale::Country now. I'll admit that in practice, I haven't had to worry to much about internationalization yet. Now that I'm using local, and the lc is only on the hash key and alpha-2, wouldn't it be ok because the alpha-2 is always ascii and the hash key is never really used for display?

    -Lee

    "To be civilized is to deny one's nature."