nyaruka / phonenumbers

GoLang port of Google's libphonenumber library
MIT License
1.25k stars 148 forks source link

Swedish format (00CC-... and +CC-...) #56

Closed leeransetton closed 4 years ago

leeransetton commented 4 years ago

According to https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers#Sweden , parsing a phone number that starts with 00 instead of + should also be supported. Currently I fixed this issue with:

regexp.MustCompile(`^\s*00`).ReplaceAllLiteralString(phoneNumber, "+")

I would appreciate it if you could support it in the lib.

Thanks

nicpottier commented 4 years ago

The aim of this library is to track the official Google implementation in Google phonenumbers: https://github.com/google/libphonenumber

To my knowledge they also do not do anything special with 00.. To my understanding 00 is a dialing convention not a way of representing a phone number, which is why it isn't supported.

You may want to bring this up with the upstream project. If they adopt it then we would as well.