Leading Double 00 in Country Code
See original GitHub issuelibphonenumber-js: v 1.0.24
node v7.10.1
I don’t get the same result/format a number to E.164
for +49
and 0049
?
libphonenumber.parse( '0049(89) 11196611' ) //returns {}
libphonenumber.parse( '0049(89) 11196611' , 'DE') //returns {}
new libphonenumber.AsYouType('DE').input('0049(89) 11196611') //'00498912196611'
libphonenumber.parse( '0049(89) 11196611' ) //returns {}
libphonenumber.parse( '0049(89) 11196611' , 'DE') //returns {}
new libphonenumber.AsYouType('DE').input('0049(89) 11196611') //'00498912196611'
The same number libphonenumber.appspot.com
Is correctly trnaformed to E.164
Is there are reason why a leading 00
is not equal to a +
? Or can it be safely tranformed:
let tel = '0049(89) 11196611'.replace(/^00/, '+')
let parsedNumber = libphonenumber.parse(tel)
if (parsedNumber.phone)
libphonenumber.format(parsedNumber.phone, parsedNumber.country, 'E.164')
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
00 is which country mobile number code? - Quora
Most countries use 00 as their international access code, though there are others like 011, ... Can same mobile number be issued to...
Read more >International Country Calling Codes and Dialing Prefixes
Ecuador 593 00
Egypt 20 00
El Salvador 503 00
Equatorial Guinea 240 00
Read more >International Calling Codes | Telephone Country Codes List
Dial the IDD, which for majority of the world is 00 or 011. Add the country code from the country code list. Then...
Read more >International Calling Codes | Country Code Search
Country, Territory or Service Areas Country Calling Codes Time Zone DST
Abkhazia +7 840, +7 940 UTC+03:00
Afghanistan +93 UTC+04:30
Åland Islands +358 18 UTC+02:00 UTC+03:00...
Read more >Leading zero after country code is seen as valid
In Germany (and e.g. UK), if you start with a country code, you leave the 0 out after the country code so the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Interestingly, this one turned out to be quite simple. Released
libphonenumber-js@1.7.44
. Closing.@360disrupt Let’s start with your case. You seem to have reported it a long time ago, and the issue seems to have been fixed since then:
Demo result:
Google’s demo result
So I guess
parsePhoneNumberFromString()
works.About
AsYouType
then. It doesn’t seem to work:I’ll see if that could be fixed.
Now, @dcustodio 's case. Provide an exact case when the library’s
parsePhoneNumberFromString
result differs from Google’s demo result. P.S.: for searching multiple numbers in text usefindPhoneNumbersInText()
function.