-
-
Notifications
You must be signed in to change notification settings - Fork 226
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 #261
Comments
Apologies, asked the chap from PhonyRails who suggested I throw it your way. |
@Carpela Apologies for the first response – I was mistaken. This does seem like a PhonyRails issue, because it's PhonyRails' decision to not return a country code if a number does not seem to be plausible. If it would return the presumed country code, then it would be no issue. |
@Carpela In fact, looking more into it – I do believe PhonyRails's process may be slightly incorrect (or I may misunderstand its workings, of course). Using vanilla Phony, we can see that if you add the CC for the UK, normalize, and check for plausibility: $ ruby -e 'require "phony"; p Phony.plausible?(Phony.normalize("4402031234567"))'
true
$ ruby -e 'require "phony"; p Phony.plausible?(Phony.normalize("4402071234567"))'
true |
It may be a good idea to pull the PhonyRails maintainer in here. @joost I like your default country code idea. I am wondering what is going wrong here – when I add the CC, then normalize, then check for plausibility, both numbers return true. What process are you using to either add the CC or not? |
Will try to find some spare minutes tomorrow to have a look :) |
Closing this issue – just reopen it if you need to. Thanks! 💃 |
This one's still a bit of an annoying issue. It seems to be falling somewhere in the gap. Not sure where to apply any change. It does seem to just be with 0203 numbers. (Which are quite a populate london number for businesses. |
I don't have any more information than I had when I wrote #261 (comment). |
Ok. I could try something but I'd likely break it.... :) def check_invalid_numbers |
@Carpela I think it's great you found a solution and are making Phony work for you (or in this case, PhonyRails)! Unfortunately, I can't change Phony as it works as advertised (it can't do magic). |
Just had a minute to look into this. Please check joost/phony_rails#95 for a fix. |
@joost Cheers 😊 |
0203 numbers (London, UK) seem to not be recognised as UK numbers
0207 numbers are handled correctly.
With country code this works fine.
=> "442031234567"
The issue appears to be the following:
Not sure how to stop Phony thinking that an 0203 number is from Egypt...?
The text was updated successfully, but these errors were encountered: