From a6d1cdbeebddd272b35eccb6c0b35fa4d63462cd Mon Sep 17 00:00:00 2001 From: lararennie Date: Wed, 5 Oct 2016 13:25:56 +0200 Subject: [PATCH] Added FAQ on why country-calling-code is not always parsed (#1377) from the start of a phone number. Relevant for the many issues lately complaining about this behaviour for German numbers (country code 49) e.g. #1335 and #1067, etc --- FAQ.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/FAQ.md b/FAQ.md index 8a9b8ab7d..303a52ecd 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,5 +1,22 @@ # Frequently Asked Questions (FAQ) +## Parsing + +### Why wasn't the country code removed when parsing? + +In some cases, the library cannot tell if the leading digits of a phone number +are intended to be the country calling code, or the start of the national +significant number. + +This affects primarily German phone numbers, where 49 is both a country calling +code and an area code, and numbers of variable lengths are valid. The leading +digits will only be interpreted as a country calling code if the number is not +already considered a possible number for the region provided when parsing. + +If you know that your numbers are always in the form <country calling +code><national significant number>, it is safe to put a "+" in front to +indicate this to the library. + ## Validation and types of numbers ### What is the difference between isPossibleNumber and isValidNumber?