diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-17 05:16:19 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-17 05:16:19 +0000 |
commit | 98cd2c7268cf9d9fd5be0b4a93b7723e1de0eb50 (patch) | |
tree | ab07d93ff1c6eb2822db22373d3ec4ae6cbc8b24 /third_party/libphonenumber | |
parent | 6b7c86c71e251def62deddcf5645eb462a432df6 (diff) | |
download | chromium_src-98cd2c7268cf9d9fd5be0b4a93b7723e1de0eb50.zip chromium_src-98cd2c7268cf9d9fd5be0b4a93b7723e1de0eb50.tar.gz chromium_src-98cd2c7268cf9d9fd5be0b4a93b7723e1de0eb50.tar.bz2 |
Normalize line endings for old libphonenumber patch files
BUG=none
TEST=none
TBR=georgey@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9413039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122460 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libphonenumber')
-rw-r--r-- | third_party/libphonenumber/patches/utf8_v186.patch | 502 | ||||
-rw-r--r-- | third_party/libphonenumber/patches/version186.patch | 164 | ||||
-rw-r--r-- | third_party/libphonenumber/patches/version277.patch | 190 |
3 files changed, 428 insertions, 428 deletions
diff --git a/third_party/libphonenumber/patches/utf8_v186.patch b/third_party/libphonenumber/patches/utf8_v186.patch index 9545bab..70a1a1d 100644 --- a/third_party/libphonenumber/patches/utf8_v186.patch +++ b/third_party/libphonenumber/patches/utf8_v186.patch @@ -1,251 +1,251 @@ -Index: D:/src/src/third_party/libphonenumber/cpp/src/phonenumberutil_test.cc
-===================================================================
---- phonenumberutil_test.cc (revision 186)
-+++ phonenumberutil_test.cc (working copy)
-@@ -1101,11 +1101,11 @@
- ExtractPossibleNumber("Tel:+800-345-600", &extracted_number);
- EXPECT_EQ("+800-345-600", extracted_number);
- // Should recognise wide digits as possible start values.
-- ExtractPossibleNumber("023", &extracted_number);
-- EXPECT_EQ("023", extracted_number);
-+ ExtractPossibleNumber("\xEF\xBC\x90\xEF\xBC\x92\xEF\xBC\x93", &extracted_number);
-+ EXPECT_EQ("\xEF\xBC\x90\xEF\xBC\x92\xEF\xBC\x93", extracted_number);
- // Dashes are not possible start values and should be removed.
-- ExtractPossibleNumber("Num-123", &extracted_number);
-- EXPECT_EQ("123", extracted_number);
-+ ExtractPossibleNumber("Num-\xEF\xBC\x91\xEF\xBC\x92\xEF\xBC\x93", &extracted_number);
-+ EXPECT_EQ("\xEF\xBC\x91\xEF\xBC\x92\xEF\xBC\x93", extracted_number);
- // If not possible number present, return empty string.
- ExtractPossibleNumber("Num-....", &extracted_number);
- EXPECT_EQ("", extracted_number);
-@@ -1119,7 +1119,7 @@
- ExtractPossibleNumber("(650) 253-0000.", &extracted_number);
- EXPECT_EQ("650) 253-0000", extracted_number);
- // This case has a trailing RTL char.
-- ExtractPossibleNumber("(650) 253-0000", &extracted_number);
-+ ExtractPossibleNumber("(650) 253-0000\xE2\x80\x8F", &extracted_number);
- EXPECT_EQ("650) 253-0000", extracted_number);
- }
-
-@@ -1163,7 +1163,7 @@
- // This number is no longer valid.
- EXPECT_FALSE(phone_util_.IsValidNumber(bs_number));
-
-- // La Mayotte and Réunion use 'leadingDigits' to differentiate them.
-+ // La Mayotte and R\xC3\xA9union use 'leadingDigits' to differentiate them.
- PhoneNumber re_number;
- re_number.set_country_code(262);
- re_number.set_national_number(262123456ULL);
-@@ -1631,13 +1631,13 @@
- EXPECT_TRUE(IsViablePhoneNumber("0800-4-PIZZA"));
- // Only one or two digits before possible punctuation followed by more digits.
- // The punctuation used here is the unicode character u+3000.
-- EXPECT_TRUE(IsViablePhoneNumber("1 34"));
-- EXPECT_FALSE(IsViablePhoneNumber("1 3+4"));
-+ EXPECT_TRUE(IsViablePhoneNumber("1\xE3\x80\x80" "34"));
-+ EXPECT_FALSE(IsViablePhoneNumber("1\xE3\x80\x80" "3+4"));
- // Unicode variants of possible starting character and other allowed
- // punctuation/digits.
-- EXPECT_TRUE(IsViablePhoneNumber("(1) 3456789"));
-+ EXPECT_TRUE(IsViablePhoneNumber("\xEF\xBC\x88" "1\xEF\xBC\x89\xE3\x80\x80" "3456789"));
- // Testing a leading + is okay.
-- EXPECT_TRUE(IsViablePhoneNumber("+1) 3456789"));
-+ EXPECT_TRUE(IsViablePhoneNumber("+1\xEF\xBC\x89\xE3\x80\x80" "3456789"));
- }
-
- TEST_F(PhoneNumberUtilTest, NormaliseRemovePunctuation) {
-@@ -1659,13 +1659,13 @@
- TEST_F(PhoneNumberUtilTest, NormaliseOtherDigits) {
- // The first digit is a full-width 2, the last digit is an Arabic-indic digit
- // 5.
-- string input_number("25٥");
-+ string input_number("\xEF\xBC\x92" "5\xD9\xA5");
- Normalize(&input_number);
- static const string kExpectedOutput("255");
- EXPECT_EQ(kExpectedOutput, input_number)
- << "Conversion did not correctly replace non-latin digits";
- // The first digit is an Eastern-Arabic 5, the latter an Eastern-Arabic 0.
-- string eastern_arabic_input_number("۵2۰");
-+ string eastern_arabic_input_number("\xDB\xB5" "2\xDB\xB0");
- Normalize(&eastern_arabic_input_number);
- static const string kExpectedOutput2("520");
- EXPECT_EQ(kExpectedOutput2, eastern_arabic_input_number)
-@@ -2321,21 +2321,21 @@
- // Using a full-width plus sign.
- test_number.Clear();
- EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR,
-- phone_util_.Parse("+1 (650) 333-6000",
-+ phone_util_.Parse("\xEF\xBC\x8B" "1 (650) 333-6000",
- RegionCode::SG(), &test_number));
- EXPECT_EQ(us_number, test_number);
- // The whole number, including punctuation, is here represented in full-width
- // form.
- test_number.Clear();
- EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR,
-- phone_util_.Parse("+1 (650) 333-6000",
-+ phone_util_.Parse("\xEF\xBC\x8B\xEF\xBC\x91\xE3\x80\x80\xEF\xBC\x88\xEF\xBC\x96\xEF\xBC\x95\xEF\xBC\x90\xEF\xBC\x89\xE3\x80\x80\xEF\xBC\x93\xEF\xBC\x93\xEF\xBC\x93\xEF\xBC\x8D\xEF\xBC\x96\xEF\xBC\x90\xEF\xBC\x90\xEF\xBC\x90",
- RegionCode::SG(), &test_number));
- EXPECT_EQ(us_number, test_number);
-
- // Using the U+30FC dash.
- test_number.Clear();
- EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR,
-- phone_util_.Parse("+1 (650) 333ー6000",
-+ phone_util_.Parse("\xEF\xBC\x8B\xEF\xBC\x91\xE3\x80\x80\xEF\xBC\x88\xEF\xBC\x96\xEF\xBC\x95\xEF\xBC\x90\xEF\xBC\x89\xE3\x80\x80\xEF\xBC\x93\xEF\xBC\x93\xEF\xBC\x93\xE3\x83\xBC\xEF\xBC\x96\xEF\xBC\x90\xEF\xBC\x90\xEF\xBC\x90",
- RegionCode::SG(), &test_number));
- EXPECT_EQ(us_number, test_number);
- }
-@@ -2575,7 +2575,7 @@
- // Test with full-width plus.
- result_proto.Clear();
- EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR,
-- phone_util_.Parse("+64 3 331 6005", RegionCode::ZZ(),
-+ phone_util_.Parse("\xEF\xBC\x8B" "64 3 331 6005", RegionCode::ZZ(),
- &result_proto));
- EXPECT_EQ(nz_number, result_proto);
- // Test with normal plus but leading characters that need to be stripped.
-@@ -2733,7 +2733,7 @@
- EXPECT_EQ(us_with_extension, test_number);
- test_number.Clear();
- EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR,
-- phone_util_.Parse("(800) 901-3355 ,extensión 7246433",
-+ phone_util_.Parse("(800) 901-3355 ,extensi\xC3\xB3n 7246433",
- RegionCode::US(),
- &test_number));
- EXPECT_EQ(us_with_extension, test_number);
-@@ -2741,7 +2741,7 @@
- // Repeat with the small letter o with acute accent created by combining
- // characters.
- EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR,
-- phone_util_.Parse("(800) 901-3355 ,extensión 7246433",
-+ phone_util_.Parse("(800) 901-3355 ,extensio\xCC\x81n 7246433",
- RegionCode::US(),
- &test_number));
- EXPECT_EQ(us_with_extension, test_number);
-Index: D:/src/src/third_party/libphonenumber/cpp/src/phonenumberutil.cc
-===================================================================
---- phonenumberutil.cc (revision 186)
-+++ phonenumberutil.cc (working copy)
-@@ -72,7 +72,7 @@
- // The kPlusSign signifies the international prefix.
- const char kPlusSign[] = "+";
-
--const char kPlusChars[] = "++";
-+const char kPlusChars[] = "+\xEF\xBC\x8B";
- scoped_ptr<const reg_exp::RegularExpression> plus_chars_pattern;
-
- const char kRfc3966ExtnPrefix[] = ";ext=";
-@@ -88,7 +88,7 @@
-
- // Digits accepted in phone numbers.
- // Both Arabic-Indic and Eastern Arabic-Indic are supported.
--const char kValidDigits[] = "0-90-9٠-٩۰-۹";
-+const char kValidDigits[] = "0-9\xEF\xBC\x90-\xEF\xBC\x99\xD9\xA0-\xD9\xA9\xDB\xB0-\xDB\xB9";
- // We accept alpha characters in phone numbers, ASCII only. We store lower-case
- // here only since our regular expressions are case-insensitive.
- const char kValidAlpha[] = "a-z";
-@@ -140,7 +140,7 @@
- // itself. In emacs, you can use M-x unicode-what to query information about the
- // unicode character.
- const char kValidPunctuation[] =
-- "-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~";
-+ "-x\xE2\x80\x90-\xE2\x80\x95\xE2\x88\x92\xE3\x83\xBC\xEF\xBC\x8D-\xEF\xBC\x8F \xC2\xA0\xE2\x80\x8B\xE2\x81\xA0\xE3\x80\x80()\xEF\xBC\x88\xEF\xBC\x89\xEF\xBC\xBB\xEF\xBC\xBD.\\[\\]/~\xE2\x81\x93\xE2\x88\xBC\xEF\xBD\x9E";
-
- // Regular expression of viable phone numbers. This is location independent.
- // Checks we have at least three leading digits, and only valid punctuation,
-@@ -454,7 +454,7 @@
- // defined order.
- void CreateRegularExpressions() {
- unique_international_prefix.reset(
-- reg_exp::CreateRegularExpression("[\\d]+(?:[~⁓∼~][\\d]+)?"));
-+ reg_exp::CreateRegularExpression("[\\d]+(?:[~\xE2\x81\x93\xE2\x88\xBC\xEF\xBD\x9E][\\d]+)?"));
- first_group_capturing_pattern.reset(
- reg_exp::CreateRegularExpression("(\\$1)"));
- carrier_code_pattern.reset(
-@@ -476,16 +476,16 @@
- StrCat("[", kPlusChars, "]*(?:[", kValidPunctuation, "]*[", kValidDigits,
- "]){3,}[", kValidAlpha, kValidPunctuation, kValidDigits, "]*")));
- // Canonical-equivalence doesn't seem to be an option with RE2, so we allow
-- // two options for representing the ó - the character itself, and one in the
-+ // two options for representing the \xC3\xB3 - the character itself, and one in the
- // unicode decomposed form with the combining acute accent. Note that there
- // are currently three capturing groups for the extension itself - if this
- // number is changed, MaybeStripExtension needs to be updated.
- const string capturing_extn_digits = StrCat("([", kValidDigits, "]{1,7})");
- known_extn_patterns.reset(new string(
- StrCat(kRfc3966ExtnPrefix, capturing_extn_digits, "|"
-- "[ \\t,]*(?:ext(?:ensi(?:ó?|ó))?n?|extn?|[,xx##~~]|"
-- "int|int|anexo)"
-- "[:\\..]?[ \\t,-]*", capturing_extn_digits, "#?|"
-+ "[ \xC2\xA0\\t,]*(?:ext(?:ensi(?:o\xCC\x81?|\xC3\xB3))?n?|\xEF\xBD\x85\xEF\xBD\x98\xEF\xBD\x94\xEF\xBD\x8E?|[,x\xEF\xBD\x98#\xEF\xBC\x83~\xEF\xBD\x9E]|"
-+ "int|\xEF\xBD\x89\xEF\xBD\x8E\xEF\xBD\x94|anexo)"
-+ "[:\\.\xEF\xBC\x8E]?[ \xC2\xA0\\t,-]*", capturing_extn_digits, "#?|"
- "[- ]+([", kValidDigits, "]{1,5})#")));
- extn_pattern.reset(reg_exp::CreateRegularExpression(
- StrCat("(?i)(?:", *known_extn_patterns, ")$").c_str()));
-@@ -509,35 +509,35 @@
- all_plus_number_grouping_symbols->insert(
- make_pair(ToUnicodeCodepoint("-"), '-'));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint("-"), '-'));
-+ make_pair(ToUnicodeCodepoint("\xEF\xBC\x8D"), '-'));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint("‐"), '-'));
-+ make_pair(ToUnicodeCodepoint("\xE2\x80\x90"), '-'));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint("‑"), '-'));
-+ make_pair(ToUnicodeCodepoint("\xE2\x80\x91"), '-'));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint("‒"), '-'));
-+ make_pair(ToUnicodeCodepoint("\xE2\x80\x92"), '-'));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint("–"), '-'));
-+ make_pair(ToUnicodeCodepoint("\xE2\x80\x93"), '-'));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint("—"), '-'));
-+ make_pair(ToUnicodeCodepoint("\xE2\x80\x94"), '-'));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint("―"), '-'));
-+ make_pair(ToUnicodeCodepoint("\xE2\x80\x95"), '-'));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint("−"), '-'));
-+ make_pair(ToUnicodeCodepoint("\xE2\x88\x92"), '-'));
- all_plus_number_grouping_symbols->insert(
- make_pair(ToUnicodeCodepoint("/"), '/'));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint("/"), '/'));
-+ make_pair(ToUnicodeCodepoint("\xEF\xBC\x8F"), '/'));
- all_plus_number_grouping_symbols->insert(
- make_pair(ToUnicodeCodepoint(" "), ' '));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint(" "), ' '));
-+ make_pair(ToUnicodeCodepoint("\xE3\x80\x80"), ' '));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint(""), ' '));
-+ make_pair(ToUnicodeCodepoint("\xE2\x81\xA0"), ' '));
- all_plus_number_grouping_symbols->insert(
- make_pair(ToUnicodeCodepoint("."), '.'));
- all_plus_number_grouping_symbols->insert(
-- make_pair(ToUnicodeCodepoint("."), '.'));
-+ make_pair(ToUnicodeCodepoint("\xEF\xBC\x8E"), '.'));
- // Only the upper-case letters are added here - the lower-case versions are
- // added programmatically.
- alpha_mappings->insert(make_pair(ToUnicodeCodepoint("A"), '2'));
-@@ -849,7 +849,7 @@
- // Note here that all NANPA formatting rules are contained by US, so we use
- // that to format NANPA numbers. The same applies to Russian Fed regions -
- // rules are contained by Russia. French Indian Ocean country rules are
-- // contained by Réunion.
-+ // contained by R\xC3\xA9union.
- string region_code;
- GetRegionCodeForCountryCode(country_calling_code, ®ion_code);
- if (!HasValidRegionCode(region_code, country_calling_code,
-@@ -1015,7 +1015,7 @@
- // For regions that share a country calling code, the country calling code
- // need not be dialled. This also applies when dialling within a region, so
- // this if clause covers both these cases.
-- // Technically this is the case for dialling from la Réunion to other
-+ // Technically this is the case for dialling from la R\xC3\xA9union to other
- // overseas departments of France (French Guiana, Martinique, Guadeloupe),
- // but not vice versa - so we don't cover this edge case for now and for
- // those cases return the version including country calling code.
+Index: D:/src/src/third_party/libphonenumber/cpp/src/phonenumberutil_test.cc +=================================================================== +--- phonenumberutil_test.cc (revision 186) ++++ phonenumberutil_test.cc (working copy) +@@ -1101,11 +1101,11 @@ + ExtractPossibleNumber("Tel:+800-345-600", &extracted_number); + EXPECT_EQ("+800-345-600", extracted_number); + // Should recognise wide digits as possible start values. +- ExtractPossibleNumber("023", &extracted_number); +- EXPECT_EQ("023", extracted_number); ++ ExtractPossibleNumber("\xEF\xBC\x90\xEF\xBC\x92\xEF\xBC\x93", &extracted_number); ++ EXPECT_EQ("\xEF\xBC\x90\xEF\xBC\x92\xEF\xBC\x93", extracted_number); + // Dashes are not possible start values and should be removed. +- ExtractPossibleNumber("Num-123", &extracted_number); +- EXPECT_EQ("123", extracted_number); ++ ExtractPossibleNumber("Num-\xEF\xBC\x91\xEF\xBC\x92\xEF\xBC\x93", &extracted_number); ++ EXPECT_EQ("\xEF\xBC\x91\xEF\xBC\x92\xEF\xBC\x93", extracted_number); + // If not possible number present, return empty string. + ExtractPossibleNumber("Num-....", &extracted_number); + EXPECT_EQ("", extracted_number); +@@ -1119,7 +1119,7 @@ + ExtractPossibleNumber("(650) 253-0000.", &extracted_number); + EXPECT_EQ("650) 253-0000", extracted_number); + // This case has a trailing RTL char. +- ExtractPossibleNumber("(650) 253-0000", &extracted_number); ++ ExtractPossibleNumber("(650) 253-0000\xE2\x80\x8F", &extracted_number); + EXPECT_EQ("650) 253-0000", extracted_number); + } + +@@ -1163,7 +1163,7 @@ + // This number is no longer valid. + EXPECT_FALSE(phone_util_.IsValidNumber(bs_number)); + +- // La Mayotte and Réunion use 'leadingDigits' to differentiate them. ++ // La Mayotte and R\xC3\xA9union use 'leadingDigits' to differentiate them. + PhoneNumber re_number; + re_number.set_country_code(262); + re_number.set_national_number(262123456ULL); +@@ -1631,13 +1631,13 @@ + EXPECT_TRUE(IsViablePhoneNumber("0800-4-PIZZA")); + // Only one or two digits before possible punctuation followed by more digits. + // The punctuation used here is the unicode character u+3000. +- EXPECT_TRUE(IsViablePhoneNumber("1 34")); +- EXPECT_FALSE(IsViablePhoneNumber("1 3+4")); ++ EXPECT_TRUE(IsViablePhoneNumber("1\xE3\x80\x80" "34")); ++ EXPECT_FALSE(IsViablePhoneNumber("1\xE3\x80\x80" "3+4")); + // Unicode variants of possible starting character and other allowed + // punctuation/digits. +- EXPECT_TRUE(IsViablePhoneNumber("(1) 3456789")); ++ EXPECT_TRUE(IsViablePhoneNumber("\xEF\xBC\x88" "1\xEF\xBC\x89\xE3\x80\x80" "3456789")); + // Testing a leading + is okay. +- EXPECT_TRUE(IsViablePhoneNumber("+1) 3456789")); ++ EXPECT_TRUE(IsViablePhoneNumber("+1\xEF\xBC\x89\xE3\x80\x80" "3456789")); + } + + TEST_F(PhoneNumberUtilTest, NormaliseRemovePunctuation) { +@@ -1659,13 +1659,13 @@ + TEST_F(PhoneNumberUtilTest, NormaliseOtherDigits) { + // The first digit is a full-width 2, the last digit is an Arabic-indic digit + // 5. +- string input_number("25٥"); ++ string input_number("\xEF\xBC\x92" "5\xD9\xA5"); + Normalize(&input_number); + static const string kExpectedOutput("255"); + EXPECT_EQ(kExpectedOutput, input_number) + << "Conversion did not correctly replace non-latin digits"; + // The first digit is an Eastern-Arabic 5, the latter an Eastern-Arabic 0. +- string eastern_arabic_input_number("۵2۰"); ++ string eastern_arabic_input_number("\xDB\xB5" "2\xDB\xB0"); + Normalize(&eastern_arabic_input_number); + static const string kExpectedOutput2("520"); + EXPECT_EQ(kExpectedOutput2, eastern_arabic_input_number) +@@ -2321,21 +2321,21 @@ + // Using a full-width plus sign. + test_number.Clear(); + EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR, +- phone_util_.Parse("+1 (650) 333-6000", ++ phone_util_.Parse("\xEF\xBC\x8B" "1 (650) 333-6000", + RegionCode::SG(), &test_number)); + EXPECT_EQ(us_number, test_number); + // The whole number, including punctuation, is here represented in full-width + // form. + test_number.Clear(); + EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR, +- phone_util_.Parse("+1 (650) 333-6000", ++ phone_util_.Parse("\xEF\xBC\x8B\xEF\xBC\x91\xE3\x80\x80\xEF\xBC\x88\xEF\xBC\x96\xEF\xBC\x95\xEF\xBC\x90\xEF\xBC\x89\xE3\x80\x80\xEF\xBC\x93\xEF\xBC\x93\xEF\xBC\x93\xEF\xBC\x8D\xEF\xBC\x96\xEF\xBC\x90\xEF\xBC\x90\xEF\xBC\x90", + RegionCode::SG(), &test_number)); + EXPECT_EQ(us_number, test_number); + + // Using the U+30FC dash. + test_number.Clear(); + EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR, +- phone_util_.Parse("+1 (650) 333ー6000", ++ phone_util_.Parse("\xEF\xBC\x8B\xEF\xBC\x91\xE3\x80\x80\xEF\xBC\x88\xEF\xBC\x96\xEF\xBC\x95\xEF\xBC\x90\xEF\xBC\x89\xE3\x80\x80\xEF\xBC\x93\xEF\xBC\x93\xEF\xBC\x93\xE3\x83\xBC\xEF\xBC\x96\xEF\xBC\x90\xEF\xBC\x90\xEF\xBC\x90", + RegionCode::SG(), &test_number)); + EXPECT_EQ(us_number, test_number); + } +@@ -2575,7 +2575,7 @@ + // Test with full-width plus. + result_proto.Clear(); + EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR, +- phone_util_.Parse("+64 3 331 6005", RegionCode::ZZ(), ++ phone_util_.Parse("\xEF\xBC\x8B" "64 3 331 6005", RegionCode::ZZ(), + &result_proto)); + EXPECT_EQ(nz_number, result_proto); + // Test with normal plus but leading characters that need to be stripped. +@@ -2733,7 +2733,7 @@ + EXPECT_EQ(us_with_extension, test_number); + test_number.Clear(); + EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR, +- phone_util_.Parse("(800) 901-3355 ,extensión 7246433", ++ phone_util_.Parse("(800) 901-3355 ,extensi\xC3\xB3n 7246433", + RegionCode::US(), + &test_number)); + EXPECT_EQ(us_with_extension, test_number); +@@ -2741,7 +2741,7 @@ + // Repeat with the small letter o with acute accent created by combining + // characters. + EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR, +- phone_util_.Parse("(800) 901-3355 ,extensión 7246433", ++ phone_util_.Parse("(800) 901-3355 ,extensio\xCC\x81n 7246433", + RegionCode::US(), + &test_number)); + EXPECT_EQ(us_with_extension, test_number); +Index: D:/src/src/third_party/libphonenumber/cpp/src/phonenumberutil.cc +=================================================================== +--- phonenumberutil.cc (revision 186) ++++ phonenumberutil.cc (working copy) +@@ -72,7 +72,7 @@ + // The kPlusSign signifies the international prefix. + const char kPlusSign[] = "+"; + +-const char kPlusChars[] = "++"; ++const char kPlusChars[] = "+\xEF\xBC\x8B"; + scoped_ptr<const reg_exp::RegularExpression> plus_chars_pattern; + + const char kRfc3966ExtnPrefix[] = ";ext="; +@@ -88,7 +88,7 @@ + + // Digits accepted in phone numbers. + // Both Arabic-Indic and Eastern Arabic-Indic are supported. +-const char kValidDigits[] = "0-90-9٠-٩۰-۹"; ++const char kValidDigits[] = "0-9\xEF\xBC\x90-\xEF\xBC\x99\xD9\xA0-\xD9\xA9\xDB\xB0-\xDB\xB9"; + // We accept alpha characters in phone numbers, ASCII only. We store lower-case + // here only since our regular expressions are case-insensitive. + const char kValidAlpha[] = "a-z"; +@@ -140,7 +140,7 @@ + // itself. In emacs, you can use M-x unicode-what to query information about the + // unicode character. + const char kValidPunctuation[] = +- "-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~"; ++ "-x\xE2\x80\x90-\xE2\x80\x95\xE2\x88\x92\xE3\x83\xBC\xEF\xBC\x8D-\xEF\xBC\x8F \xC2\xA0\xE2\x80\x8B\xE2\x81\xA0\xE3\x80\x80()\xEF\xBC\x88\xEF\xBC\x89\xEF\xBC\xBB\xEF\xBC\xBD.\\[\\]/~\xE2\x81\x93\xE2\x88\xBC\xEF\xBD\x9E"; + + // Regular expression of viable phone numbers. This is location independent. + // Checks we have at least three leading digits, and only valid punctuation, +@@ -454,7 +454,7 @@ + // defined order. + void CreateRegularExpressions() { + unique_international_prefix.reset( +- reg_exp::CreateRegularExpression("[\\d]+(?:[~⁓∼~][\\d]+)?")); ++ reg_exp::CreateRegularExpression("[\\d]+(?:[~\xE2\x81\x93\xE2\x88\xBC\xEF\xBD\x9E][\\d]+)?")); + first_group_capturing_pattern.reset( + reg_exp::CreateRegularExpression("(\\$1)")); + carrier_code_pattern.reset( +@@ -476,16 +476,16 @@ + StrCat("[", kPlusChars, "]*(?:[", kValidPunctuation, "]*[", kValidDigits, + "]){3,}[", kValidAlpha, kValidPunctuation, kValidDigits, "]*"))); + // Canonical-equivalence doesn't seem to be an option with RE2, so we allow +- // two options for representing the ó - the character itself, and one in the ++ // two options for representing the \xC3\xB3 - the character itself, and one in the + // unicode decomposed form with the combining acute accent. Note that there + // are currently three capturing groups for the extension itself - if this + // number is changed, MaybeStripExtension needs to be updated. + const string capturing_extn_digits = StrCat("([", kValidDigits, "]{1,7})"); + known_extn_patterns.reset(new string( + StrCat(kRfc3966ExtnPrefix, capturing_extn_digits, "|" +- "[ \\t,]*(?:ext(?:ensi(?:ó?|ó))?n?|extn?|[,xx##~~]|" +- "int|int|anexo)" +- "[:\\..]?[ \\t,-]*", capturing_extn_digits, "#?|" ++ "[ \xC2\xA0\\t,]*(?:ext(?:ensi(?:o\xCC\x81?|\xC3\xB3))?n?|\xEF\xBD\x85\xEF\xBD\x98\xEF\xBD\x94\xEF\xBD\x8E?|[,x\xEF\xBD\x98#\xEF\xBC\x83~\xEF\xBD\x9E]|" ++ "int|\xEF\xBD\x89\xEF\xBD\x8E\xEF\xBD\x94|anexo)" ++ "[:\\.\xEF\xBC\x8E]?[ \xC2\xA0\\t,-]*", capturing_extn_digits, "#?|" + "[- ]+([", kValidDigits, "]{1,5})#"))); + extn_pattern.reset(reg_exp::CreateRegularExpression( + StrCat("(?i)(?:", *known_extn_patterns, ")$").c_str())); +@@ -509,35 +509,35 @@ + all_plus_number_grouping_symbols->insert( + make_pair(ToUnicodeCodepoint("-"), '-')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint("-"), '-')); ++ make_pair(ToUnicodeCodepoint("\xEF\xBC\x8D"), '-')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint("‐"), '-')); ++ make_pair(ToUnicodeCodepoint("\xE2\x80\x90"), '-')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint("‑"), '-')); ++ make_pair(ToUnicodeCodepoint("\xE2\x80\x91"), '-')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint("‒"), '-')); ++ make_pair(ToUnicodeCodepoint("\xE2\x80\x92"), '-')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint("–"), '-')); ++ make_pair(ToUnicodeCodepoint("\xE2\x80\x93"), '-')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint("—"), '-')); ++ make_pair(ToUnicodeCodepoint("\xE2\x80\x94"), '-')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint("―"), '-')); ++ make_pair(ToUnicodeCodepoint("\xE2\x80\x95"), '-')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint("−"), '-')); ++ make_pair(ToUnicodeCodepoint("\xE2\x88\x92"), '-')); + all_plus_number_grouping_symbols->insert( + make_pair(ToUnicodeCodepoint("/"), '/')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint("/"), '/')); ++ make_pair(ToUnicodeCodepoint("\xEF\xBC\x8F"), '/')); + all_plus_number_grouping_symbols->insert( + make_pair(ToUnicodeCodepoint(" "), ' ')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint(" "), ' ')); ++ make_pair(ToUnicodeCodepoint("\xE3\x80\x80"), ' ')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint(""), ' ')); ++ make_pair(ToUnicodeCodepoint("\xE2\x81\xA0"), ' ')); + all_plus_number_grouping_symbols->insert( + make_pair(ToUnicodeCodepoint("."), '.')); + all_plus_number_grouping_symbols->insert( +- make_pair(ToUnicodeCodepoint("."), '.')); ++ make_pair(ToUnicodeCodepoint("\xEF\xBC\x8E"), '.')); + // Only the upper-case letters are added here - the lower-case versions are + // added programmatically. + alpha_mappings->insert(make_pair(ToUnicodeCodepoint("A"), '2')); +@@ -849,7 +849,7 @@ + // Note here that all NANPA formatting rules are contained by US, so we use + // that to format NANPA numbers. The same applies to Russian Fed regions - + // rules are contained by Russia. French Indian Ocean country rules are +- // contained by Réunion. ++ // contained by R\xC3\xA9union. + string region_code; + GetRegionCodeForCountryCode(country_calling_code, ®ion_code); + if (!HasValidRegionCode(region_code, country_calling_code, +@@ -1015,7 +1015,7 @@ + // For regions that share a country calling code, the country calling code + // need not be dialled. This also applies when dialling within a region, so + // this if clause covers both these cases. +- // Technically this is the case for dialling from la Réunion to other ++ // Technically this is the case for dialling from la R\xC3\xA9union to other + // overseas departments of France (French Guiana, Martinique, Guadeloupe), + // but not vice versa - so we don't cover this edge case for now and for + // those cases return the version including country calling code. diff --git a/third_party/libphonenumber/patches/version186.patch b/third_party/libphonenumber/patches/version186.patch index 63afbfaa..c2885e5 100644 --- a/third_party/libphonenumber/patches/version186.patch +++ b/third_party/libphonenumber/patches/version186.patch @@ -1,8 +1,8 @@ -Index: regexp_adapter.h
-===================================================================
---- regexp_adapter.h (revision 0)
-+++ regexp_adapter.h (revision 0)
-@@ -0,0 +1,96 @@
+Index: regexp_adapter.h +=================================================================== +--- regexp_adapter.h (revision 0) ++++ regexp_adapter.h (revision 0) +@@ -0,0 +1,96 @@ +// Copyright (C) 2011 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); @@ -99,17 +99,17 @@ Index: regexp_adapter.h +} // namespace reg_exp + +#endif // I18N_PHONENUMBERS_REGEXP_ADAPTER_H_ -
-Property changes on: regexp_adapter.h
-___________________________________________________________________
-Added: svn:eol-style
- + LF
-
-Index: regexp_adapter_re2.cc
-===================================================================
---- regexp_adapter_re2.cc (revision 0)
-+++ regexp_adapter_re2.cc (revision 0)
-@@ -0,0 +1,192 @@
+ +Property changes on: regexp_adapter.h +___________________________________________________________________ +Added: svn:eol-style + + LF + +Index: regexp_adapter_re2.cc +=================================================================== +--- regexp_adapter_re2.cc (revision 0) ++++ regexp_adapter_re2.cc (revision 0) +@@ -0,0 +1,192 @@ +// Copyright (C) 2011 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); @@ -302,17 +302,17 @@ Index: regexp_adapter_re2.cc + +} // namespace reg_exp + -
-Property changes on: regexp_adapter_re2.cc
-___________________________________________________________________
-Added: svn:eol-style
- + LF
-
-Index: phonenumberutil_test.cc
-===================================================================
---- phonenumberutil_test.cc (revision 186)
-+++ phonenumberutil_test.cc (working copy)
-@@ -21,12 +21,12 @@
+ +Property changes on: regexp_adapter_re2.cc +___________________________________________________________________ +Added: svn:eol-style + + LF + +Index: phonenumberutil_test.cc +=================================================================== +--- phonenumberutil_test.cc (revision 186) ++++ phonenumberutil_test.cc (working copy) +@@ -21,12 +21,12 @@ #include <string> #include <gtest/gtest.h> @@ -326,11 +326,11 @@ Index: phonenumberutil_test.cc #include "test_metadata.h" namespace i18n { -Index: phonenumberutil.cc
-===================================================================
---- phonenumberutil.cc (revision 186)
-+++ phonenumberutil.cc (working copy)
-@@ -25,8 +25,6 @@
+Index: phonenumberutil.cc +=================================================================== +--- phonenumberutil.cc (revision 186) ++++ phonenumberutil.cc (working copy) +@@ -25,8 +25,6 @@ #include <vector> #include <google/protobuf/message_lite.h> @@ -339,7 +339,7 @@ Index: phonenumberutil.cc #include <unicode/errorcode.h> #include <unicode/translit.h> -@@ -38,7 +36,7 @@
+@@ -38,7 +36,7 @@ #include "phonemetadata.pb.h" #include "phonenumber.h" #include "phonenumber.pb.h" @@ -348,7 +348,7 @@ Index: phonenumberutil.cc #include "stringutil.h" #include "utf/unicodetext.h" #include "utf/utf.h" -@@ -54,14 +52,11 @@
+@@ -54,14 +52,11 @@ using std::stringstream; using google::protobuf::RepeatedPtrField; @@ -363,7 +363,7 @@ Index: phonenumberutil.cc // These objects are created in the function InitializeStaticMapsAndSets. // These mappings map a character (key) to a specific digit that should replace -@@ -78,7 +73,7 @@
+@@ -78,7 +73,7 @@ const char kPlusSign[] = "+"; const char kPlusChars[] = "++"; @@ -372,7 +372,7 @@ Index: phonenumberutil.cc const char kRfc3966ExtnPrefix[] = ";ext="; -@@ -89,7 +84,7 @@
+@@ -89,7 +84,7 @@ // prefixes in a region, they will be represented as a regex string that always // contains character(s) other than ASCII digits. // Note this regex also includes tilde, which signals waiting for the tone. @@ -381,7 +381,7 @@ Index: phonenumberutil.cc // Digits accepted in phone numbers. // Both Arabic-Indic and Eastern Arabic-Indic are supported. -@@ -97,8 +92,8 @@
+@@ -97,8 +92,8 @@ // We accept alpha characters in phone numbers, ASCII only. We store lower-case // here only since our regular expressions are case-insensitive. const char kValidAlpha[] = "a-z"; @@ -392,7 +392,7 @@ Index: phonenumberutil.cc // Regular expression of acceptable characters that may start a phone number // for the purposes of parsing. This allows us to strip away meaningless -@@ -110,7 +105,7 @@
+@@ -110,7 +105,7 @@ // a number. The string starting with this valid character is captured. // This corresponds to VALID_START_CHAR in the java version. scoped_ptr<const string> valid_start_char; @@ -401,7 +401,7 @@ Index: phonenumberutil.cc // Regular expression of characters typically used to start a second phone // number for the purposes of parsing. This allows us to strip off parts of -@@ -121,7 +116,8 @@
+@@ -121,7 +116,8 @@ // preceding this is captured. // This corresponds to SECOND_NUMBER_START in the java version. const char kCaptureUpToSecondNumberStart[] = "(.*)[\\\\/] *x"; @@ -411,7 +411,7 @@ Index: phonenumberutil.cc // Regular expression of trailing characters that we want to remove. We remove // all characters that are not alpha or numerical characters. The hash -@@ -130,7 +126,7 @@
+@@ -130,7 +126,7 @@ // number if this was a match. // This corresponds to UNWANTED_END_CHARS in the java version. const char kUnwantedEndChar[] = "[^\\p{N}\\p{L}#]"; @@ -420,7 +420,7 @@ Index: phonenumberutil.cc // Regular expression of acceptable punctuation found in phone numbers. This // excludes punctuation found as a leading character only. This consists of -@@ -177,20 +173,20 @@
+@@ -177,20 +173,20 @@ scoped_ptr<const string> known_extn_patterns; // Regexp of all known extension prefixes used by different regions followed // by 1 or more valid digits, for use when parsing. @@ -446,7 +446,7 @@ Index: phonenumberutil.cc void TransformRegularExpressionToRE2Syntax(string* regex) { DCHECK(regex); -@@ -280,18 +276,19 @@
+@@ -280,18 +276,19 @@ it = available_formats.begin(); it != available_formats.end(); ++it) { int size = it->leading_digits_pattern_size(); if (size > 0) { @@ -473,7 +473,7 @@ Index: phonenumberutil.cc string formatting_pattern(it->format()); if (number_format == PhoneNumberUtil::NATIONAL && carrier_code.length() > 0 && -@@ -299,11 +296,12 @@
+@@ -299,11 +296,12 @@ // Replace the $CC in the formatting rule with the desired carrier code. string carrier_code_formatting_rule = it->domestic_carrier_code_formatting_rule(); @@ -490,7 +490,7 @@ Index: phonenumberutil.cc } else { // Use the national prefix formatting rule instead. string national_prefix_formatting_rule = -@@ -315,14 +313,15 @@
+@@ -315,14 +313,15 @@ // should be formatted at this point. TransformRegularExpressionToRE2Syntax( &national_prefix_formatting_rule); @@ -510,7 +510,7 @@ Index: phonenumberutil.cc return; } } -@@ -361,12 +360,14 @@
+@@ -361,12 +360,14 @@ bool IsNumberMatchingDesc(const string& national_number, const PhoneNumberDesc& number_desc) { @@ -531,7 +531,7 @@ Index: phonenumberutil.cc } PhoneNumberUtil::PhoneNumberType GetNumberTypeHelper( -@@ -452,18 +453,25 @@
+@@ -452,18 +453,25 @@ // Initialisation helper function used to populate the regular expressions in a // defined order. void CreateRegularExpressions() { @@ -567,7 +567,7 @@ Index: phonenumberutil.cc valid_phone_number.reset(new string( StrCat("[", kPlusChars, "]*(?:[", kValidPunctuation, "]*[", kValidDigits, "]){3,}[", kValidAlpha, kValidPunctuation, kValidDigits, "]*"))); -@@ -479,17 +487,19 @@
+@@ -479,17 +487,19 @@ "int|int|anexo)" "[:\\..]?[ \\t,-]*", capturing_extn_digits, "#?|" "[- ]+([", kValidDigits, "]{1,5})#"))); @@ -594,7 +594,7 @@ Index: phonenumberutil.cc all_plus_number_grouping_symbols.reset(new map<char32, char>); alpha_mappings.reset(new map<char32, char>); all_normalization_mappings.reset(new map<char32, char>); -@@ -625,36 +635,37 @@
+@@ -625,36 +635,37 @@ // Strips the IDD from the start of the number if present. Helper function used // by MaybeStripInternationalPrefixAndNormalize. @@ -642,7 +642,7 @@ Index: phonenumberutil.cc return PhoneNumberUtil::TOO_LONG; } else { return PhoneNumberUtil::TOO_SHORT; -@@ -862,8 +873,10 @@
+@@ -862,8 +873,10 @@ PhoneNumberFormat number_format, const RepeatedPtrField<NumberFormat>& user_defined_formats, string* formatted_number) const { @@ -655,7 +655,7 @@ Index: phonenumberutil.cc DCHECK(formatted_number); int country_calling_code = number.country_code(); // Note GetRegionCodeForCountryCode() is used because formatting information -@@ -893,10 +906,12 @@
+@@ -893,10 +906,12 @@ num_format_copy->MergeFrom(*it); if (!national_prefix.empty()) { // Replace $NP with national prefix and $FG with the first group ($1). @@ -672,7 +672,7 @@ Index: phonenumberutil.cc num_format_copy->set_national_prefix_formatting_rule( national_prefix_formatting_rule); } else { -@@ -1021,7 +1036,8 @@
+@@ -1021,7 +1036,8 @@ // format of the number is returned, unless there is a preferred international // prefix. string international_prefix_for_formatting( @@ -682,7 +682,7 @@ Index: phonenumberutil.cc ? international_prefix : metadata->preferred_international_prefix()); if (!international_prefix_for_formatting.empty()) { -@@ -1133,7 +1149,8 @@
+@@ -1133,7 +1149,8 @@ // format of the number is returned, unless there is a preferred international // prefix. string international_prefix_for_formatting( @@ -692,7 +692,7 @@ Index: phonenumberutil.cc ? international_prefix : metadata->preferred_international_prefix()); if (!international_prefix_for_formatting.empty()) { -@@ -1179,8 +1196,10 @@
+@@ -1179,8 +1196,10 @@ number, carrier_code, formatted_number); if (number_format == RFC3966) { // Replace all separators with a "-". @@ -705,7 +705,7 @@ Index: phonenumberutil.cc } } -@@ -1288,10 +1307,9 @@
+@@ -1288,10 +1307,9 @@ it != region_codes.end(); ++it) { const PhoneMetadata* metadata = GetMetadataForRegion(*it); if (metadata->has_leading_digits()) { @@ -719,7 +719,7 @@ Index: phonenumberutil.cc *region_code = *it; return; } -@@ -1367,8 +1385,10 @@
+@@ -1367,8 +1385,10 @@ const string& number_to_parse, const string& default_region) const { if (!IsValidRegionCode(default_region) && !number_to_parse.empty()) { @@ -732,7 +732,7 @@ Index: phonenumberutil.cc return false; } } -@@ -1435,8 +1455,6 @@
+@@ -1435,8 +1455,6 @@ return TOO_SHORT_NSN; } if (country_metadata) { @@ -741,7 +741,7 @@ Index: phonenumberutil.cc string* carrier_code = keep_raw_input ? temp_number.mutable_preferred_domestic_carrier_code() : NULL; MaybeStripNationalPrefixAndCarrierCode(*country_metadata, -@@ -1489,7 +1507,7 @@
+@@ -1489,7 +1507,7 @@ for (it = number_as_unicode.begin(); it != number_as_unicode.end(); ++it) { len = it.get_utf8(current_char); current_char[len] = '\0'; @@ -750,7 +750,7 @@ Index: phonenumberutil.cc break; } } -@@ -1505,7 +1523,7 @@
+@@ -1505,7 +1523,7 @@ for (; reverse_it.base() != it; ++reverse_it) { len = reverse_it.get_utf8(current_char); current_char[len] = '\0'; @@ -759,7 +759,7 @@ Index: phonenumberutil.cc break; } } -@@ -1521,9 +1539,9 @@
+@@ -1521,9 +1539,9 @@ " left with: " + *extracted_number); // Now remove any extra numbers at the end. @@ -772,7 +772,7 @@ Index: phonenumberutil.cc } bool PhoneNumberUtil::IsPossibleNumber(const PhoneNumber& number) const { -@@ -1569,9 +1587,10 @@
+@@ -1569,9 +1587,10 @@ return IS_POSSIBLE; } } @@ -786,7 +786,7 @@ Index: phonenumberutil.cc national_number); } -@@ -1701,13 +1720,16 @@
+@@ -1701,13 +1720,16 @@ string formatted_number; Format(copied_proto, INTERNATIONAL, &formatted_number); @@ -806,7 +806,7 @@ Index: phonenumberutil.cc // We should find at least three groups. return 0; } -@@ -1734,9 +1756,11 @@
+@@ -1734,9 +1756,11 @@ void PhoneNumberUtil::NormalizeDigitsOnly(string* number) { DCHECK(number); // Delete everything that isn't valid digits. @@ -821,7 +821,7 @@ Index: phonenumberutil.cc // Normalize all decimal digits to ASCII digits. UParseError error; icu::ErrorCode status; -@@ -1778,7 +1802,7 @@
+@@ -1778,7 +1802,7 @@ string number_copy(number); string extension; MaybeStripExtension(&number_copy, &extension); @@ -830,7 +830,7 @@ Index: phonenumberutil.cc } void PhoneNumberUtil::ConvertAlphaCharactersInNumber(string* number) const { -@@ -1798,7 +1822,7 @@
+@@ -1798,7 +1822,7 @@ // - Arabic-Indic numerals are converted to European numerals. void PhoneNumberUtil::Normalize(string* number) const { DCHECK(number); @@ -839,7 +839,7 @@ Index: phonenumberutil.cc NormalizeHelper(*all_normalization_mappings, true, number); } NormalizeDigitsOnly(number); -@@ -1816,7 +1840,7 @@
+@@ -1816,7 +1840,7 @@ logger->Debug("Number too short to be viable:" + number); return false; } @@ -848,7 +848,7 @@ Index: phonenumberutil.cc } // Strips any international prefix (such as +, 00, 011) present in the number -@@ -1836,17 +1860,20 @@
+@@ -1836,17 +1860,20 @@ if (number->empty()) { return PhoneNumber::FROM_DEFAULT_COUNTRY; } @@ -874,7 +874,7 @@ Index: phonenumberutil.cc Normalize(number); return PhoneNumber::FROM_NUMBER_WITH_IDD; } -@@ -1854,7 +1881,7 @@
+@@ -1854,7 +1881,7 @@ // This shouldn't be done before, since non-numeric characters (+ and ~) may // legally be in the international prefix. Normalize(number); @@ -883,7 +883,7 @@ Index: phonenumberutil.cc ? PhoneNumber::FROM_NUMBER_WITH_IDD : PhoneNumber::FROM_DEFAULT_COUNTRY; } -@@ -1879,25 +1906,25 @@
+@@ -1879,25 +1906,25 @@ } // We use two copies here since Consume modifies the phone number, and if the // first if-clause fails the number will already be changed. @@ -922,7 +922,7 @@ Index: phonenumberutil.cc !captured_part_of_prefix.empty()) { string re2_transform_rule(transform_rule); TransformRegularExpressionToRE2Syntax(&re2_transform_rule); -@@ -1905,29 +1932,27 @@
+@@ -1905,29 +1932,27 @@ // have been some part of the prefix that we captured. // We make the transformation and check that the resultant number is viable. // If so, replace the number and return. @@ -964,7 +964,7 @@ Index: phonenumberutil.cc if (carrier_code) { carrier_code->assign(carrier_code_temp); } -@@ -1949,11 +1974,13 @@
+@@ -1949,11 +1974,13 @@ string possible_extension_two; string possible_extension_three; string number_copy(*number); @@ -982,7 +982,7 @@ Index: phonenumberutil.cc logger->Debug("Found an extension. Possible extension one: " + possible_extension_one + ". Possible extension two: " + possible_extension_two -@@ -2061,25 +2088,29 @@
+@@ -2061,25 +2088,29 @@ &potential_national_number)) { const PhoneNumberDesc& general_num_desc = default_region_metadata->general_desc(); @@ -1022,11 +1022,11 @@ Index: phonenumberutil.cc == TOO_LONG) { national_number->assign(potential_national_number); if (keep_raw_input) { -Index: regexp_adapter_unittest.cc
-===================================================================
---- regexp_adapter_unittest.cc (revision 0)
-+++ regexp_adapter_unittest.cc (revision 0)
-@@ -0,0 +1,142 @@
+Index: regexp_adapter_unittest.cc +=================================================================== +--- regexp_adapter_unittest.cc (revision 0) ++++ regexp_adapter_unittest.cc (revision 0) +@@ -0,0 +1,142 @@ +// Copyright (C) 2011 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); @@ -1169,9 +1169,9 @@ Index: regexp_adapter_unittest.cc + +} // namespace reg_exp + -
-Property changes on: regexp_adapter_unittest.cc
-___________________________________________________________________
-Added: svn:eol-style
- + LF
-
+ +Property changes on: regexp_adapter_unittest.cc +___________________________________________________________________ +Added: svn:eol-style + + LF + diff --git a/third_party/libphonenumber/patches/version277.patch b/third_party/libphonenumber/patches/version277.patch index c65a141..63807df3 100644 --- a/third_party/libphonenumber/patches/version277.patch +++ b/third_party/libphonenumber/patches/version277.patch @@ -1,8 +1,8 @@ -Index: src/regexp_cache.cc
-===================================================================
---- src/regexp_cache.cc (revision 277)
-+++ src/regexp_cache.cc (working copy)
-@@ -26,35 +26,17 @@
+Index: src/regexp_cache.cc +=================================================================== +--- src/regexp_cache.cc (revision 277) ++++ src/regexp_cache.cc (working copy) +@@ -26,35 +26,17 @@ using std::string; @@ -42,11 +42,11 @@ Index: src/regexp_cache.cc RegExpCache::~RegExpCache() { AutoLock l(lock_); -Index: src/phonenumberutil_test.cc
-===================================================================
---- src/phonenumberutil_test.cc (revision 277)
-+++ src/phonenumberutil_test.cc (working copy)
-@@ -1145,11 +1145,11 @@
+Index: src/phonenumberutil_test.cc +=================================================================== +--- src/phonenumberutil_test.cc (revision 277) ++++ src/phonenumberutil_test.cc (working copy) +@@ -1145,11 +1145,11 @@ ExtractPossibleNumber("Tel:+800-345-600", &extracted_number); EXPECT_EQ("+800-345-600", extracted_number); // Should recognise wide digits as possible start values. @@ -62,7 +62,7 @@ Index: src/phonenumberutil_test.cc // If not possible number present, return empty string. ExtractPossibleNumber("Num-....", &extracted_number); EXPECT_EQ("", extracted_number); -@@ -1163,7 +1163,7 @@
+@@ -1163,7 +1163,7 @@ ExtractPossibleNumber("(650) 253-0000.", &extracted_number); EXPECT_EQ("650) 253-0000", extracted_number); // This case has a trailing RTL char. @@ -71,7 +71,7 @@ Index: src/phonenumberutil_test.cc EXPECT_EQ("650) 253-0000", extracted_number); } -@@ -1207,7 +1207,7 @@
+@@ -1207,7 +1207,7 @@ // This number is no longer valid. EXPECT_FALSE(phone_util_.IsValidNumber(bs_number)); @@ -80,7 +80,7 @@ Index: src/phonenumberutil_test.cc PhoneNumber re_number; re_number.set_country_code(262); re_number.set_national_number(262123456ULL); -@@ -1675,13 +1675,13 @@
+@@ -1675,13 +1675,13 @@ EXPECT_TRUE(IsViablePhoneNumber("0800-4-PIZZA")); // Only one or two digits before possible punctuation followed by more digits. // The punctuation used here is the unicode character u+3000. @@ -98,7 +98,7 @@ Index: src/phonenumberutil_test.cc } TEST_F(PhoneNumberUtilTest, ConvertAlphaCharactersInNumber) { -@@ -1692,8 +1692,8 @@
+@@ -1692,8 +1692,8 @@ EXPECT_EQ(kExpectedOutput, input); // Try with some non-ASCII characters. @@ -109,7 +109,7 @@ Index: src/phonenumberutil_test.cc phone_util_.ConvertAlphaCharactersInNumber(&input); EXPECT_EQ(kExpectedFullwidthOutput, input); } -@@ -1717,13 +1717,13 @@
+@@ -1717,13 +1717,13 @@ TEST_F(PhoneNumberUtilTest, NormaliseOtherDigits) { // The first digit is a full-width 2, the last digit is an Arabic-indic digit // 5. @@ -125,7 +125,7 @@ Index: src/phonenumberutil_test.cc Normalize(&eastern_arabic_input_number); static const string kExpectedOutput2("520"); EXPECT_EQ(kExpectedOutput2, eastern_arabic_input_number) -@@ -2379,21 +2379,21 @@
+@@ -2379,21 +2379,21 @@ // Using a full-width plus sign. test_number.Clear(); EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR, @@ -150,7 +150,7 @@ Index: src/phonenumberutil_test.cc RegionCode::SG(), &test_number)); EXPECT_EQ(us_number, test_number); } -@@ -2633,7 +2633,7 @@
+@@ -2633,7 +2633,7 @@ // Test with full-width plus. result_proto.Clear(); EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR, @@ -159,7 +159,7 @@ Index: src/phonenumberutil_test.cc &result_proto)); EXPECT_EQ(nz_number, result_proto); // Test with normal plus but leading characters that need to be stripped. -@@ -2792,7 +2792,7 @@
+@@ -2792,7 +2792,7 @@ EXPECT_EQ(us_with_extension, test_number); test_number.Clear(); EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR, @@ -168,7 +168,7 @@ Index: src/phonenumberutil_test.cc RegionCode::US(), &test_number)); EXPECT_EQ(us_with_extension, test_number); -@@ -2800,7 +2800,7 @@
+@@ -2800,7 +2800,7 @@ // Repeat with the small letter o with acute accent created by combining // characters. EXPECT_EQ(PhoneNumberUtil::NO_PARSING_ERROR, @@ -177,11 +177,11 @@ Index: src/phonenumberutil_test.cc RegionCode::US(), &test_number)); EXPECT_EQ(us_with_extension, test_number); -Index: src/regexp_cache.h
-===================================================================
---- src/regexp_cache.h (revision 277)
-+++ src/regexp_cache.h (working copy)
-@@ -37,10 +37,7 @@
+Index: src/regexp_cache.h +=================================================================== +--- src/regexp_cache.h (revision 277) ++++ src/regexp_cache.h (working copy) +@@ -37,10 +37,7 @@ #ifdef USE_TR1_UNORDERED_MAP # include <tr1/unordered_map> #elif defined(USE_HASH_MAP) @@ -193,7 +193,7 @@ Index: src/regexp_cache.h #else # error STL map type unsupported on this platform! #endif -@@ -57,7 +54,7 @@
+@@ -57,7 +54,7 @@ #ifdef USE_TR1_UNORDERED_MAP typedef std::tr1::unordered_map<string, const RegExp*> CacheImpl; #elif defined(USE_HASH_MAP) @@ -202,11 +202,11 @@ Index: src/regexp_cache.h #endif public: -Index: src/phonenumberutil.cc
-===================================================================
---- src/phonenumberutil.cc (revision 277)
-+++ src/phonenumberutil.cc (working copy)
-@@ -33,7 +33,7 @@
+Index: src/phonenumberutil.cc +=================================================================== +--- src/phonenumberutil.cc (revision 277) ++++ src/phonenumberutil.cc (working copy) +@@ -33,7 +33,7 @@ #include <unicode/utf8.h> #include "base/logging.h" @@ -215,7 +215,7 @@ Index: src/phonenumberutil.cc #include "default_logger.h" #include "encoding_utils.h" #include "metadata.h" -@@ -62,7 +62,7 @@
+@@ -62,7 +62,7 @@ using google::protobuf::RepeatedPtrField; // static @@ -224,7 +224,7 @@ Index: src/phonenumberutil.cc // To find out the unicode code-point of the characters below in vim, highlight // the character and type 'ga'. Note that the - is used to express ranges of // full-width punctuation below, as well as being present in the expression -@@ -70,7 +70,7 @@
+@@ -70,7 +70,7 @@ // unicode character. // static const char PhoneNumberUtil::kValidPunctuation[] = @@ -233,7 +233,7 @@ Index: src/phonenumberutil.cc namespace { -@@ -450,35 +450,35 @@
+@@ -450,35 +450,35 @@ all_plus_number_grouping_symbols->insert( make_pair(ToUnicodeCodepoint("-"), '-')); all_plus_number_grouping_symbols->insert( @@ -281,7 +281,7 @@ Index: src/phonenumberutil.cc // Only the upper-case letters are added here - the lower-case versions are // added programmatically. alpha_mappings->insert(make_pair(ToUnicodeCodepoint("A"), '2')); -@@ -684,15 +684,13 @@
+@@ -684,15 +684,13 @@ // Public wrapper function to get a PhoneNumberUtil instance with the default // metadata file. // static @@ -298,7 +298,7 @@ Index: src/phonenumberutil.cc // The first_group_capturing_pattern was originally set to $1 but there are // some countries for which the first group is not used in the national // pattern (e.g. Argentina) so the $1 group does not match correctly. -@@ -713,16 +711,16 @@
+@@ -713,16 +711,16 @@ StrCat("[", kPlusChars, "]*(?:[", kValidPunctuation, "]*[", kDigits, "]){3,}[", kValidAlpha, kValidPunctuation, kDigits, "]*"))); // Canonical-equivalence doesn't seem to be an option with RE2, so we allow @@ -319,7 +319,7 @@ Index: src/phonenumberutil.cc "[- ]+([", kDigits, "]{1,5})#"))); extn_pattern.reset(RegExp::Create( StrCat("(?i)(?:", *known_extn_patterns, ")$"))); -@@ -828,7 +826,7 @@
+@@ -828,7 +826,7 @@ // Note here that all NANPA formatting rules are contained by US, so we use // that to format NANPA numbers. The same applies to Russian Fed regions - // rules are contained by Russia. French Indian Ocean country rules are @@ -328,7 +328,7 @@ Index: src/phonenumberutil.cc string region_code; GetRegionCodeForCountryCode(country_calling_code, ®ion_code); if (!HasValidRegionCode(region_code, country_calling_code, -@@ -987,7 +985,7 @@
+@@ -987,7 +985,7 @@ // For regions that share a country calling code, the country calling code // need not be dialled. This also applies when dialling within a region, so // this if clause covers both these cases. @@ -337,11 +337,11 @@ Index: src/phonenumberutil.cc // overseas departments of France (French Guiana, Martinique, Guadeloupe), // but not vice versa - so we don't cover this edge case for now and for // those cases return the version including country calling code. -Index: src/logger.h
-===================================================================
---- src/logger.h (revision 277)
-+++ src/logger.h (working copy)
-@@ -20,7 +20,7 @@
+Index: src/logger.h +=================================================================== +--- src/logger.h (revision 277) ++++ src/logger.h (working copy) +@@ -20,7 +20,7 @@ #include <cstdio> #include <string> @@ -350,11 +350,11 @@ Index: src/logger.h namespace i18n { namespace phonenumbers { -Index: src/regexp_adapter_test.cc
-===================================================================
---- src/regexp_adapter_test.cc (revision 277)
-+++ src/regexp_adapter_test.cc (working copy)
-@@ -186,12 +186,12 @@
+Index: src/regexp_adapter_test.cc +=================================================================== +--- src/regexp_adapter_test.cc (revision 277) ++++ src/regexp_adapter_test.cc (working copy) +@@ -186,12 +186,12 @@ } TEST(RegExpAdapter, TestUtf8) { @@ -371,11 +371,11 @@ Index: src/regexp_adapter_test.cc } } // namespace phonenumbers -Index: src/phonenumberutil.h
-===================================================================
---- src/phonenumberutil.h (revision 277)
-+++ src/phonenumberutil.h (working copy)
-@@ -29,7 +29,7 @@
+Index: src/phonenumberutil.h +=================================================================== +--- src/phonenumberutil.h (revision 277) ++++ src/phonenumberutil.h (working copy) +@@ -29,7 +29,7 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" @@ -384,7 +384,7 @@ Index: src/phonenumberutil.h #include "phonenumber.pb.h" class TelephoneNumber; -@@ -57,20 +57,15 @@
+@@ -57,20 +57,15 @@ // codes can be found here: // http://www.iso.org/iso/english_country_names_and_code_elements @@ -406,7 +406,7 @@ Index: src/phonenumberutil.h // format, and as "044 668 1800" in NATIONAL format. E164 format is as per // INTERNATIONAL format but with no formatting applied e.g. +41446681800. // RFC3966 is as per INTERNATIONAL format, but with all spaces and other -@@ -147,9 +142,7 @@
+@@ -147,9 +142,7 @@ // // The PhoneNumberUtil is implemented as a singleton. Therefore, calling // getInstance multiple times will only result in one instance being created. @@ -416,11 +416,11 @@ Index: src/phonenumberutil.h // Initialisation helper function used to populate the regular expressions in // a defined order. -Index: src/default_logger.h
-===================================================================
---- src/default_logger.h (revision 277)
-+++ src/default_logger.h (working copy)
-@@ -45,7 +45,11 @@
+Index: src/default_logger.h +=================================================================== +--- src/default_logger.h (revision 277) ++++ src/default_logger.h (working copy) +@@ -45,7 +45,11 @@ struct ConvertToString<int> { static inline string DoWork(const int& n) { char buffer[16]; @@ -432,7 +432,7 @@ Index: src/default_logger.h return string(buffer); } }; -@@ -77,19 +81,6 @@
+@@ -77,19 +81,6 @@ namespace i18n { namespace phonenumbers { @@ -452,11 +452,11 @@ Index: src/default_logger.h // Default logger implementation used by PhoneNumberUtil class. It outputs the // messages to the standard output. class StdoutLogger : public Logger { -Index: src/base/string_piece.cc
-===================================================================
---- src/base/string_piece.cc (revision 277)
-+++ src/base/string_piece.cc (working copy)
-@@ -1,219 +0,0 @@
+Index: src/base/string_piece.cc +=================================================================== +--- src/base/string_piece.cc (revision 277) ++++ src/base/string_piece.cc (working copy) +@@ -1,219 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. @@ -676,11 +676,11 @@ Index: src/base/string_piece.cc -const StringPiece::size_type StringPiece::npos = size_type(-1); - -} // namespace base -Index: src/base/synchronization/lock.h
-===================================================================
---- src/base/synchronization/lock.h (revision 277)
-+++ src/base/synchronization/lock.h (working copy)
-@@ -1,27 +0,0 @@
+Index: src/base/synchronization/lock.h +=================================================================== +--- src/base/synchronization/lock.h (revision 277) ++++ src/base/synchronization/lock.h (working copy) +@@ -1,27 +0,0 @@ -// Copyright (C) 2011 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); @@ -708,11 +708,11 @@ Index: src/base/synchronization/lock.h -} - -#endif // I18N_PHONENUMBERS_BASE_SYNCHRONIZATION_LOCK_H_ -Index: src/base/string_piece.h
-===================================================================
---- src/base/string_piece.h (revision 277)
-+++ src/base/string_piece.h (working copy)
-@@ -1,192 +0,0 @@
+Index: src/base/string_piece.h +=================================================================== +--- src/base/string_piece.h (revision 277) ++++ src/base/string_piece.h (working copy) +@@ -1,192 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. @@ -905,11 +905,11 @@ Index: src/base/string_piece.h -} // namespace base - -#endif // BASE_STRING_PIECE_H_ -Index: src/base/scoped_ptr.h
-===================================================================
---- src/base/scoped_ptr.h (revision 277)
-+++ src/base/scoped_ptr.h (working copy)
-@@ -1,24 +0,0 @@
+Index: src/base/scoped_ptr.h +=================================================================== +--- src/base/scoped_ptr.h (revision 277) ++++ src/base/scoped_ptr.h (working copy) +@@ -1,24 +0,0 @@ -// Copyright (C) 2011 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); @@ -934,11 +934,11 @@ Index: src/base/scoped_ptr.h -using boost::scoped_ptr; - -#endif // I18N_PHONENUMBERS_BASE_SCOPED_PTR_H_ -Index: src/base/singleton.h
-===================================================================
---- src/base/singleton.h (revision 277)
-+++ src/base/singleton.h (working copy)
-@@ -1,52 +0,0 @@
+Index: src/base/singleton.h +=================================================================== +--- src/base/singleton.h (revision 277) ++++ src/base/singleton.h (working copy) +@@ -1,52 +0,0 @@ -// Copyright (C) 2011 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); @@ -991,11 +991,11 @@ Index: src/base/singleton.h -} // namespace i18n - -#endif // I18N_PHONENUMBERS_BASE_SINGLETON_H_ -Index: src/base/basictypes.h
-===================================================================
---- src/base/basictypes.h (revision 277)
-+++ src/base/basictypes.h (working copy)
-@@ -1,380 +0,0 @@
+Index: src/base/basictypes.h +=================================================================== +--- src/base/basictypes.h (revision 277) ++++ src/base/basictypes.h (working copy) +@@ -1,380 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. @@ -1376,11 +1376,11 @@ Index: src/base/basictypes.h -} // base - -#endif // BASE_BASICTYPES_H_ -Index: src/base/logging.h
-===================================================================
---- src/base/logging.h (revision 277)
-+++ src/base/logging.h (working copy)
-@@ -1,33 +0,0 @@
+Index: src/base/logging.h +=================================================================== +--- src/base/logging.h (revision 277) ++++ src/base/logging.h (working copy) +@@ -1,33 +0,0 @@ -// Copyright (C) 2011 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); |