phonenumber
phonenumber copied to clipboard
Inconsistent (?) UK Mobile Number Parsing
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 https://github.com/dongri/phonenumber/issues/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:
- +44 07700900000 (technically erroneous- the
0at 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) - 07700900000 (as dialled from within the UK)
- 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.