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

Bug while parsing +17345465 #40

Open
abhinavsingh opened this issue Oct 13, 2021 · 1 comment
Open

Bug while parsing +17345465 #40

abhinavsingh opened this issue Oct 13, 2021 · 1 comment

Comments

@abhinavsingh
Copy link

libPhoneNumber.parse("+17345465") returns {international: +1 268-734-5465, national: (268) 734-5465, type: mobile, e164: +12687345465, country_code: 1, national_number: 2687345465}.

Unsure from where does 268 comes from. We haven't seen this behavior with any other number.

Can someone explain the rationale here?

Thank you

@abhinavsingh
Copy link
Author

I read further about flutter-libphonenumber. Looks like it doesn't re-use existing native library but is an implementation of it's specification. Clearly there are some edge cases not taken cared of.

Example, here is a result from Python libphonenumber which underneath uses native lib. Same issue is not reproducible there.

>>> import phonenumbers
>>> phonenumbers.parse("+17345465")
PhoneNumber(country_code=1, national_number=7345465, extension=None, italian_leading_zero=None, number_of_leading_zeros=None, country_code_source=0, preferred_domestic_carrier_code=None)

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

1 participant