National Numer - Leading Zero in CarrierNumberEditText
Closed this issue · 3 comments
I am using the CountryCodePicker in combination with the CarrierNumberEditText.
For Austria, the hinted number shows with a leading zero (used for national dialing): 0664 12345.
If the user enters the number like that "0664 12345", and I use getFullNumberWithPlus(); to read it, ccp returns "+43066412345" whereas it should return "+4366412345".
How can I make sure that the national prefix is not included in the number I receive from ccp?
When debugging the code, I saw that the national 0 was added in PhoneNumberUtil => format => maybeAppendFormatExtension due to the fact that you set the flag to NATIONAL.
Same issue happens in one of my projects. Phone number present in the hint has a leading 0
which should actually not be there, when the country is Ukraine.
Issue is caused in my case by CountryCodePIcker#setPhoneNumberHint#L1180
:
...
String hint = mPhoneUtil.format(phoneNumber, PhoneNumberUtil.PhoneNumberFormat.NATIONAL);
...
Changing the Phone number format to PhoneNumberUtil.PhoneNumberFormat.INTERNATIONAL
fixes it.
I would say that the vast majority of folks who use this library would be interested in an INTERNATIONAL format for the phone numbers.
What about changing the format used throught the library from NATIONAL
to INTERNATIONAL
?
@joielechong any chance for this to happen?
No activity & no need anymore. Closing issue.