-
Notifications
You must be signed in to change notification settings - Fork 132
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
international format fails on german mobile numbers #168
Comments
In rails, this behavior can be fixed by adding |
@Shonyyyyy number 491511234567 is not valid by google's regex, their regex says that there should be 8 symbols after 151. Phonelib.parse('49 151 12345678').international # => "+49 1511 2345678" Since number is not valid, for countries with option to have double country prefix, library tries to add additional country prefix and reparse, and in case it's valid, the new number will be returned. So suggestion offered by @chiefjuss is not good. Phonelib.parse('+49 151 1234567').valid? # => false In case 7 digits numbers are valid, you need to open an issue in original google lib |
ok, thank you very much so far. I will try out that |
wiki says https://en.wikipedia.org/wiki/Telephone_numbers_in_Germany
so i assume |
@krtschmr As I saw they are not accepting wiki as official data source, they require links to some authoritative source. Note that prefix Phonelib.parse('4915111234567').international # => "+49 1511 1234567" Currently google library still returns |
When parsing a german phone number string by calling
Phonelib.parse().international
the parsed number gets an extra country_code number.E.g.:
Phonelib.parse('491511234567').international
returns+49 491 511234567
.Expected would be:
+49 151 1234567
.This only appears when the following is given:
The text was updated successfully, but these errors were encountered: