DrHyde / perl-modules-Number-Phone

Number::Phone and friends
24 stars 31 forks source link

Åland Islands stub country get ignored #73

Closed 39832 closed 7 years ago

39832 commented 7 years ago

Number::Phone::Lib maps a number to a country before validating it by libphonenumber. The initial mapping leads to the list (Finland, Åland), and then it ignores Åland and chooses Finland, and then libphonenumber says that Åland numbers aren't in Finland. Number::Phone has other instances of lists, such as Vatican, Mayotte and Christmas Island, but I haven't checked what libphonenumber does with them.

DrHyde commented 7 years ago

Do you have a snippet of code I can use as a test case?

39832 commented 7 years ago

new Number::Phone::Lib("+358 18 3456789");

DrHyde commented 7 years ago

What version of Number::Phone are you using? It works with the most recent stable release:

$ perl -MNumber::Phone -E 'say $Number::Phone::VERSION'
3.4001
$ perl -MNumber::Phone::Lib -E 'say Number::Phone::Lib->new("+358 18 3456789")->country()'
AX
$ perl -MData::Dumper -MNumber::Phone::Lib -E 'say Dumper(Number::Phone::Lib->new("+358 18 3456789")->type())'
$VAR1 = 'is_valid';
$VAR2 = 'is_geographic';
$VAR3 = 'is_fixed_line';
39832 commented 7 years ago

Yes, I must have been checking against an old version by accident.