* Update lock_posix.h
Remove uses of the deprecated DISALLOW_COPY_AND_ASSIGN in favor of explicitly deleted constructors and assignment operators.
* Remove uses of the deprecated DISALLOW_COPY_AND_ASSIGN in favor of explicitly deleted constructors and assignment operators.
* Add check for `phone-context`.
Add a check to PhoneNumberUtil that the value of the `phone-context` parameter of the tel URI follows the correct syntax as defined in [RFC3966](https://www.rfc-editor.org/rfc/rfc3966#section-3).
* Add check for `phone-context`.
Add a check to PhoneNumberUtil that the value of the `phone-context` parameter of the tel URI follows the correct syntax as defined in [RFC3966](https://www.rfc-editor.org/rfc/rfc3966#section-3).
* Add check for `phone-context`.
Add a check to PhoneNumberUtil that the value of the `phone-context` parameter of the tel URI follows the correct syntax as defined in [RFC3966](https://www.rfc-editor.org/rfc/rfc3966#section-3).
- Faced link errors stemmed from mismatch of api definitions of absl::node_hash_set. So explicitly mentioned this lib as dependency during linking. This is common case/solution for absl hash set lib's link errors as per community.
- Decided to continued to have wrapper (stringutil), so that in future it's easy if we decided to change implementation; client code is safe. Changed most of the implementations & data structures in stringutil, to use abseil stuffs more.
- Though absl::string_view is suitable for most cases where we want immutable/read-only string structures, limiting to stringutil apis, not changing public API signatures (even though no compliance issue); reason: reduce dependency on abseil libs.
- Abseil specific changes done:
- std::set => absl::node_hash_set
- std::map => absl::node_hash_map
- Using absl alternatives for “SplitStringUsing” API and “StringHolder” class impl.
- Replaced manual impl of prefix and suffix checks with absl::StartsWith() and absl::EndsWith.
- Similarly used absl::StrReplaceAll, absl::StrCat, absl::StrAppend where possible; and for type conversion apis.
- Note: Tried applying parameter packs to replace manually written duplicate ```StrCat``` apis (for accommodating more number of parameters of same type), but it did not go well when different type arguments passed. Eg char, int types to be converted to StringHolder; faced constructor implicit conversion issues.
Keep track of whether unicode strings were created from valid UTF-8 and
use this to abort operations that use these strings later.
Typically, this is done by returning an empty string when a modified
string is being produced, since an empty string is never a valid phone
number.
@API updates:
- Migrating from associative containers to more performant types. Eg: map to absl::btree_map.
- Synchronise the write access to map "AreaCodeMaps" using absl::Mutex locking api.
- Use more of absl:strings packages like absl::StrReplaceAll
@Build updates:
- To build (CMake) against absl packages, the minimum version of compiler is CPP11+, whereas earlier we are not mandating this.
- We are upgrading CMAKE version also to automate building the external absl packages.
The change is announced. Please report issues in case of any breakages.
https://issuetracker.google.com/issues?q=componentid:192347%20555
Earlier, AYTF is adding additional CC when returning unformatted result - for cases where the input digits are dropped for formatting. Eg: MX case: "+5213314010666" => "+52 +5213314010666". b/183053929
Now we. are proactively ensuring that no formatting is applied, where a format is chosen that would otherwise have led to some digits being dropped.
Why the input digits are dropped:
- In MX, the mobile token (1) is no more used, so when it is present in input, the formatted result should not contain it.
- However when AYTF, we should not be removing the input digits on the fly.
- More details in cl/373115460 and b/183053929
* Abolish MX's international mobile token
* Porting phoneutil changes to JS and AYTF changes to not to swallow parts that are not part of formatting rule.
* Make fake change to trigger travis build again
* Adding checking of leading digits before using an alternate format rule
when finding phone numbers in text (previously we thought this was done, hence why the data was there, but it wasn't).
Also some minor comment/formatting changes, and splitting a private helper method
into two.
The format of the data has changed such that formatting patterns now only refer to \d, not specific numbers, so we don't need the special handling in the AYTF code which converts them to \d.
* Update ShortNumberInfo test regarding example number change for region AM. Unlike PhoneNumberUtilTest, ShortNumberInfoTest uses real metadata for unit testing.
* Changing the region as Travis tests do not pass with old short metadata of AM
* Making same changes in CPP and JS
* Configure Russian extension character доб as a valid one while parsing the numbers
* Escaping non ascii characters for better standardization.
* Added generated RU test data file. This is why travis test are failing at: https://travis-ci.org/googlei18n/libphonenumber/builds/407078226
* Removing manual support of encoded versions as it is already taken care in RegEx flags. Updated based on new review comments.
This enum won't be noticed by most users, because the country_code_source field of the phone number is only populated with ParseAndKeepRawInput, and in this case, this enum won't be used.
However, it provides a better result for users who incorrectly call parse() and then getCountryCodeSource() and expect to get a sensible answer; now they will get UNSPECIFIED instead of FROM_NUMBER_WITH_PLUS_SIGN which was the default before. In JS this method returns null, but getCountryCodeSourceOrDefault() will now return UNSPECIFIED instead.
The numeric values of the existing enums have not changed (relevant for JS and C++) and in Java the new enum was added to the end so that any stored serialized phone numbers should be able to be restored as they were before.
Suggested in issue #1218
* It was confusing and unnecessary. Not every country that has short numbers beginning with a 0 had it, and it is not the only digit that could overlap with a national prefix and hence be interpreted incorrectly.
* Make canBeInternationallyDialled_API public in Java and CPP
* update notes in pending_code_changes.txt
* Remove TODO on canBeInternationallyDialled as it is already an public API in JS
* Make JS canBeInternationallyDialled API doc consistent with Java and CPP
* Handling possible out-of-bounds exception that would be thrown in C++
and Java if a number with a phone-context tag is entered (RFC3966
format) but no actual phone context.
* isNumberMatch fix for numbers with italian leading zero fields set. Only
affects people who haven't correctly constructed phone numbers using
methods like 'parse'.
* Adding C++ tests and fixing bug in ExactlySameAs method, which wasn't
updated to handle the number_of_leading_zeros field when that was added
to the phone number proto.
See pending_code_changes.txt for more details.
* Support semicolon as extension character while parsing
* Add notes to pending_code_changes.txt
* JS port: Support semicolon as extension character while parsing
* Update comments in phonenumberutil.js
Metadata changes:
-- Drops the "-1" that was erroneously included in possible lengths before (didn't break anything, but was wrong) - it was a possibleLength of a sub-component so got added to the generalDesc possibleLengths
-- possibleNumberPattern no longer inherited: we don't use this anyway, we will do another CL soon to stop including it at all in the generated metadata
-- exampleNumber is no longer set on fixed-line and mobile elements from the generalDesc
XML file changes:
-- Stopped specifying "NA" and "-1" specifically for fixed-line and mobile blocks; now they are treated as every other type of phone number: if missing, don't fill them in from generalDesc, but leave them missing.
Code changes:
-- Stop using the exampleNumber on generalDesc for non-geo entities, but look at their phonenumber descs - the exampleNumber won't be stored on the generalDesc anymore. This affects porters if they either copied our build logic or used our built metadata in some way; they should update this method in their port too.