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

Some phoneNumber return +xx NA on the #97

Open
GaLlaKk opened this issue Apr 10, 2019 · 5 comments
Open

Some phoneNumber return +xx NA on the #97

GaLlaKk opened this issue Apr 10, 2019 · 5 comments

Comments

@GaLlaKk
Copy link

GaLlaKk commented Apr 10, 2019

Hello,

I used your csharp version of the library but there is a difference with the java version on some phonenumbers (on the international format), the csharp version return +xx NA whereas the java version return the complete number.

Example :

        PhoneNumbers.PhoneNumberUtil phoneUtil;

        phoneUtil = PhoneNumbers.PhoneNumberUtil.GetInstance();
        var phone = phoneUtil.Parse("+55999830563", "BR");

        Console.WriteLine(
        phoneUtil.Format(phone, PhoneNumbers.PhoneNumberFormat.INTERNATIONAL)
        );

//result : + NA

Same result whith this number :

+00932905150 AF
+542018587 AR
+9942000022 AZ
+0085577555508 BR
+975260930 BT
+00866826288 CN
+5932380613 EC
+33100842 FR
+8100337946505 JP
+73330501 KZ
+7 (931) 402-1 RU

@twcclegg
Copy link
Owner

It seems that all those phone numbers are invalid

URL country_code_source appspot result csharp result
http://libphonenumber.appspot.com/phonenumberparser?number=%2B55999830563&country=BR FROM_NUMBER_WITH_PLUS_SIGN isValidNumber -> false +55 999830563
http://libphonenumber.appspot.com/phonenumberparser?number=%2B00932905150&country=AF FROM_NUMBER_WITH_IDD isValidNumber -> false NumberParseException
http://libphonenumber.appspot.com/phonenumberparser?number=%2B542018587&country=AR FROM_NUMBER_WITH_PLUS_SIGN isValidNumber -> false +54 2018587
http://libphonenumber.appspot.com/phonenumberparser?number=%2B9942000022&country=AZ FROM_NUMBER_WITH_PLUS_SIGN isValidNumber -> false NumberParseException
http://libphonenumber.appspot.com/phonenumberparser?number=%2B0085577555508&country=BR INVALID_COUNTRY_CODE. Could not interpret numbers after plus-sign. NumberParseException
http://libphonenumber.appspot.com/phonenumberparser?number=%2B975260930&country=BT FROM_NUMBER_WITH_PLUS_SIGN isValidNumber -> false NumberParseException
http://libphonenumber.appspot.com/phonenumberparser?number=%2B00866826288&country=CN FROM_NUMBER_WITH_IDD isValidNumber -> false +86 6826288
http://libphonenumber.appspot.com/phonenumberparser?number=%2B5932380613&country=EC FROM_NUMBER_WITH_PLUS_SIGN isValidNumber -> false NumberParseException
http://libphonenumber.appspot.com/phonenumberparser?number=%2B33100842&country=FR FROM_NUMBER_WITH_PLUS_SIGN isPossibleNumber -> false TOO_SHORT isValidShortNumber -> false +33 100842
http://libphonenumber.appspot.com/phonenumberparser?number=%2B8100337946505&country=JP FROM_NUMBER_WITH_PLUS_SIGN isValidNumber -> false +81 0337946505
http://libphonenumber.appspot.com/phonenumberparser?number=%2B73330501&country=KZ FROM_NUMBER_WITH_PLUS_SIGN isValidNumber -> false +7 3330501
http://libphonenumber.appspot.com/phonenumberparser?number=%2B7+%28931%29+402-1&country=RU FROM_NUMBER_WITH_PLUS_SIGNisValidNumber -> false +7 9314021

It would seem that there is a bug in that this library does provide output in some invalid cases.

@lenthib
Copy link

lenthib commented Feb 11, 2020

Hi!

I have the same issue with a ValidNumber : 16833203 CN
https://libphonenumber.appspot.com/phonenumberparser?number=16833203&country=CN

@twcclegg
Copy link
Owner

That number in NSN with country code and E164 both show as valid with even with versions of the library at least a year old. https://dotnetfiddle.net/CXvwYF

@lenthib
Copy link

lenthib commented Feb 11, 2020

Thank you for your fast answer.

But I already know this is a valid number, my problem is the International format returned by LibPhoneNumber is like "+XXNA"

image

What do you mean by NSN please ?

@twcclegg
Copy link
Owner

Sorry, I confused this with an issue filed yesterday. This I'll to try to make some time to better dig into the issue.

and National Significant 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

3 participants