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

Inconsistent (?) UK Mobile Number Parsing #49

Open
jspc opened this issue Oct 29, 2024 · 1 comment
Open

Inconsistent (?) UK Mobile Number Parsing #49

jspc opened this issue Oct 29, 2024 · 1 comment

Comments

@jspc
Copy link

jspc commented Oct 29, 2024

Hey,

Firstly: thank you for this package; it's saved me a lot of work, and I'm very grateful for it.

I'm having a similar issue to #45

Given the UK Mobile Number 07700 900000 (I've sourced this from here, so I'm confident I'm not about to leak somebody's phone number) in three formats:

  1. +44 07700900000 (technically erroneous- the 0 at the start should be omitted when the country code is added, but it's a common format and recognised by every phone I've tested on today)
  2. 07700900000 (as dialled from within the UK)
  3. 447700900000 (an e.164 taken from a SIP header sent by an asterisk system)

I'd expect either the same result from Parse, or for the first example to fail because it's incorrect. What actually happens is examples 2 and 3 succeed, but the first returns 4407700900000 - which is not a valid E.164 phone number.

You can see this in action on the playground: https://go.dev/play/p/bGUGdqLNY0C

Am I doing something wrong? I'm happy to open a PR, but I want to make sure there's not already a solution.

@dongri dongri mentioned this issue Oct 29, 2024
@dongri
Copy link
Owner

dongri commented Oct 29, 2024

@jspc
Thank you for your report.
I've created a pull request with the following modifications. Could you please review it?
https://github.com/dongri/phonenumber/pull/50/files

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