From 1fa84183243126b4b12f0da520f66a8e49e3c59c Mon Sep 17 00:00:00 2001 From: mandlil <138015259+mandlil@users.noreply.github.com> Date: Wed, 18 Oct 2023 11:53:54 +0530 Subject: [PATCH] Parsing issue with "(8108) 6309 390 906" (RU) while parsing the number the first 3 digits are discarding, due to that it is giving the wrong country code as "86". --- .../src/com/google/i18n/phonenumbers/PhoneNumberUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java b/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java index 1f49d6747..e5133f8b7 100644 --- a/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java +++ b/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java @@ -2876,6 +2876,9 @@ public class PhoneNumberUtil { String possibleCountryIddPrefix = "NonMatch"; if (defaultRegionMetadata != null) { possibleCountryIddPrefix = defaultRegionMetadata.getInternationalPrefix(); + if ( defaultRegionMetadata.getId().equals("RU") && possibleCountryIddPrefix.contains("810")) { + possibleCountryIddPrefix = "00"; + } } CountryCodeSource countryCodeSource =