Browse Source

Cleanup in continuation to support of Russian extension characters (#2250)

* Cleanup in continuation to support to russian extension characters

* Nit: \xBE (uppercase E) for consistency
pull/2253/head
penmetsaa 7 years ago
committed by GitHub
parent
commit
c47097bc6c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions
  1. +1
    -1
      cpp/src/phonenumbers/phonenumberutil.cc
  2. +1
    -1
      java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java
  3. +1
    -1
      java/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java
  4. +3
    -3
      javascript/i18n/phonenumbers/phonenumberutil.js

+ 1
- 1
cpp/src/phonenumbers/phonenumberutil.cc View File

@ -227,7 +227,7 @@ string CreateExtnPattern(const string& single_extn_symbols) {
"[:\\..]?[  \\t,-]*", capturing_extn_digits, "#?|" */
"[ \xC2\xA0\\t,]*(?:e?xt(?:ensi(?:o\xCC\x81?|\xC3\xB3))?n?|"
"(?:\xEF\xBD\x85)?\xEF\xBD\x98\xEF\xBD\x94(?:\xEF\xBD\x8E)?|"
"доб|[", single_extn_symbols, "]|int|"
"\xD0\xB4\xD0\xBE\xD0\xB1|[", single_extn_symbols, "]|int|"
"\xEF\xBD\x89\xEF\xBD\x8E\xEF\xBD\x94|anexo)"
"[:\\.\xEF\xBC\x8E]?[ \xC2\xA0\\t,-]*", capturing_extn_digits,
"#?|[- ]+([", kDigits, "]{1,5})#"));


+ 1
- 1
java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java View File

@ -341,7 +341,7 @@ public class PhoneNumberUtil {
// form with the combining acute accent.
return (RFC3966_EXTN_PREFIX + CAPTURING_EXTN_DIGITS + "|" + "[ \u00A0\\t,]*"
+ "(?:e?xt(?:ensi(?:o\u0301?|\u00F3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|"
+ "доб|" + "[" + singleExtnSymbols + "]|int|anexo|\uFF49\uFF4E\uFF54)"
+ "\u0434\u043E\u0431|" + "[" + singleExtnSymbols + "]|int|anexo|\uFF49\uFF4E\uFF54)"
+ "[:\\.\uFF0E]?[ \u00A0\\t,-]*" + CAPTURING_EXTN_DIGITS + "#?|"
+ "[- ]+(" + DIGITS + "{1,5})#");
}


+ 1
- 1
java/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java View File

@ -2662,7 +2662,7 @@ public class PhoneNumberUtilTest extends TestMetadataTestCase {
phoneUtil.parse("8 (423) 202-25-11\u0434\u043E\u0431100", RegionCode.RU));
// In upper case
assertEquals(ruWithExtension,
phoneUtil.parse("8 (423) 202-25-11, \u0414\u041E\u0431. 100", RegionCode.RU));
phoneUtil.parse("8 (423) 202-25-11, \u0414\u041E\u0411. 100", RegionCode.RU));
// Test that if a number has two extensions specified, we ignore the second.
PhoneNumber usWithTwoExtensionsNumber = new PhoneNumber();


+ 3
- 3
javascript/i18n/phonenumbers/phonenumberutil.js View File

@ -778,11 +778,11 @@ i18n.phonenumbers.PhoneNumberUtil.CAPTURING_EXTN_DIGITS_ =
i18n.phonenumbers.PhoneNumberUtil.EXTN_PATTERNS_FOR_PARSING_ =
i18n.phonenumbers.PhoneNumberUtil.RFC3966_EXTN_PREFIX_ +
i18n.phonenumbers.PhoneNumberUtil.CAPTURING_EXTN_DIGITS_ + '|' +
'[ \xA0\\t,]*' +
'[ \u00A0\\t,]*' +
'(?:e?xt(?:ensi(?:o\u0301?|\u00F3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|' +
'\u0434\u043E\u0431|\u0414\u041E\u0411|' +
'\u0434\u043E\u0431|' +
'[;,x\uFF58#\uFF03~\uFF5E]|int|anexo|\uFF49\uFF4E\uFF54)' +
'[:\\.\uFF0E]?[ \xA0\\t,-]*' +
'[:\\.\uFF0E]?[ \u00A0\\t,-]*' +
i18n.phonenumbers.PhoneNumberUtil.CAPTURING_EXTN_DIGITS_ + '#?|' +
'[- ]+([' + i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ + ']{1,5})#';


Loading…
Cancel
Save