Skip to content

Commit

Permalink
Rationalise +7
Browse files Browse the repository at this point in the history
  • Loading branch information
DrHyde committed Jul 8, 2011
1 parent 46fd57c commit d275c10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
23 changes: 6 additions & 17 deletions lib/Number/Phone/Country.pm
Expand Up @@ -99,7 +99,11 @@ sub import {
688 => 'TV',
689 => 'PF', 690 => 'TK', 691 => 'FM', 692 => 'MH',

# 7 => 'RU & KZ',
# 7* from http://en.wikipedia.org/wiki/Telephone_numbers_in_Kazakhstan
# checked 2011-07-08
76 => 'KZ',
77 => 'KZ',
7 => 'RU',

# 8* checked against wtng.info 2011-07-08
81 => 'JP', 82 => 'KR', 84 => 'VN', 850 => 'KP',
Expand Down Expand Up @@ -267,7 +271,7 @@ sub import {
'KR' => [ '82', '001', '0'], # Korea (South)
'KW' => ['965', '00', '0'], # Kuwait
'KY' => [ '1', '011', '1'], # Cayman Islands
'KZ' => [ '7', '810', '8'], # Kazakhstan (IDD really 8**10)
'KZ' => [ '7', '810', '8'], # Kazakhstan (IDD really 8[pause]10)
'LA' => ['856', '00', '0'], # Laos
'LB' => ['961', '00', '0'], # Lebanon
'LC' => [ '1', '011', '1'], # Saint Lucia
Expand Down Expand Up @@ -520,21 +524,6 @@ sub phone2country_and_idd {
else { return ('NANP', 1); }
}

# following are from http://www.itu.int/itudoc/itu-t/number/k/kaz/75917.html
# and http://wtng.info/ccod-7.html
# see also http://wtng.info/wtng-kk.html#Kazakstan
elsif($phone =~ /^7/) {
return ('KZ', 7) if($phone =~ /^7(
300|
310|311|312|313|314|315|316|317|318|
320|321|322|323|324|325|326|327|328|329|
333|336|
570|571|573|574|
700
)/x);
return ('RU', 7);
}

else {
my @retards = map { substr($phone, 0, $_) } reverse 1..length($phone);
foreach my $idd (@retards) {
Expand Down
2 changes: 1 addition & 1 deletion t/54_number-phone-country-prefix.t
Expand Up @@ -268,7 +268,7 @@ VU:678:00:
WF:681:19:
WS:685:0:0
YE:967:00:0
YT:269:00:
YT:262:00:
ZA:27:09:0
ZM:260:00:0
ZW:263:110:0

0 comments on commit d275c10

Please sign in to comment.