libphonenumber-csharp
libphonenumber-csharp copied to clipboard
Some phoneNumber return +xx NA on the
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
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.
Hi!
I have the same issue with a ValidNumber : 16833203 CN https://libphonenumber.appspot.com/phonenumberparser?number=16833203&country=CN
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
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"
What do you mean by NSN please ?
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