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.
* Refer using string::std instead of global 'string' i.e to increase portablility, readability and also consistent
* Using 'using' to avoid mentioning namespace everytime
This also requires updating code that previously took a shortcut and
depended on the Rune and char32 typedefs to be identical (which is no
longer the case, as Rune is now unsigned).
R=jia.shao.peng@gmail.com
BUG=
Review URL: https://codereview.appspot.com/136920043
They generated static initializers on Clang/Mac.
This also adds the previously missing <algorithm> include in unicodetext.cc
causing a compilation error on VS2013.
This is a squash of (very slightly modified) patches contributed by thakis@ and
yosin@.
R=roes@google.com
Review URL: https://codereview.appspot.com/14930044
This CL ensures that:
- All declarations in headers are made in the i18n::phonenumbers namespace.
- All USE flags/macros are prefixed with I18N_PHONENUMBERS_ to avoid name
clashes.
- All the code in base/ is actually used (by deleting unused code).
- Outdated occurrences of USE_GOOGLE_BASE don't exist anymore.
- Logging in PhoneNumberUtil is disabled by default (in production). However it
can be enabled by calling PhoneNumberUtil::SetLogger() as it is now done
during testing.
BUG=http://crbug.com/236272R=jia.shao.peng@gmail.com
Review URL: https://codereview.appspot.com/9162043