Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UK 0203 numbers not handled correctly #95

Closed
Carpela opened this issue Jun 5, 2015 · 4 comments
Closed

UK 0203 numbers not handled correctly #95

Carpela opened this issue Jun 5, 2015 · 4 comments

Comments

@Carpela
Copy link

Carpela commented Jun 5, 2015

0203 numbers (London, UK) seem to not be recognised as UK numbers

[13] pry(main)> PhonyRails.normalize_number('02031234567', default_country_code:'GB', add_plus:false)
=> "2031234567"

0207 numbers are handled correctly.

[14] pry(main)> PhonyRails.normalize_number('02071234567', default_country_code:'GB', add_plus:false)
=> "442071234567"

With country code this works fine.

[15] pry(main)> PhonyRails.normalize_number('02031234567', country_code:'GB', add_plus:false)

=> "442031234567"

The issue appears to be the following:

[24] pry(main)> Phony.plausible?('02031234567')
=> true
[25] pry(main)> Phony.plausible?('02071234567')
=> false
[22] pry(main)> PhonyRails.country_code_from_number('02031234567')
=> "20"
[23] pry(main)> PhonyRails.country_code_from_number('02071234567')
=> nil

Not sure how to stop Phony thinking that an 0203 number is from Egypt...?

@joost
Copy link
Owner

joost commented Jun 18, 2015

Please move the issue to https://github.com/floere/phony.

@joost joost closed this as completed Jun 18, 2015
@Carpela
Copy link
Author

Carpela commented Sep 3, 2015

HI, did we get anywhere on this? I don't think it's phony causing the issue but not sure quite how to fix it.
floere/phony#261

@joost
Copy link
Owner

joost commented Sep 30, 2015

@Carpela no.. i haven't had time to look into it. Feel free to do so :)

@joost
Copy link
Owner

joost commented Nov 12, 2015

Check the commit for more info. Now using the default_country_code/number if it generates a plausible number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants