Browse Source

Update Javadoc for PhoneNumberUtil.PhoneNumberFormat enum reg E.123 format rules we follow (#2021)

* Update Javadoc for PhoneNumberUtil.PhoneNumberFormat enum about E.123 format.  We over.

* JS update

* Comment fix
pull/2029/head
penmetsaa 8 years ago
committed by GitHub
parent
commit
3db7670b42
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 22 deletions
  1. +9
    -8
      cpp/src/phonenumbers/phonenumberutil.h
  2. +7
    -6
      java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java
  3. +9
    -8
      javascript/i18n/phonenumbers/phonenumberutil.js

+ 9
- 8
cpp/src/phonenumbers/phonenumberutil.h View File

@ -69,14 +69,15 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
static const char kRegionCodeForNonGeoEntity[];
// INTERNATIONAL and NATIONAL formats are consistent with the definition
// in ITU-T Recommendation E. 123. For example, the number of the Google
// Zürich office will be written as "+41 44 668 1800" in INTERNATIONAL
// 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
// separating symbols replaced with a hyphen, and with any phone number
// extension appended with ";ext=". It also will have a prefix of "tel:"
// added, e.g. "tel:+41-44-668-1800".
// in ITU-T Recommendation E.123. However we follow local conventions such as
// using '-' instead of whitespace as separators. For example, the number of
// the Google Switzerland office will be written as "+41 44 668 1800" in
// INTERNATIONAL 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 separating symbols replaced with a hyphen, and with any phone
// number extension appended with ";ext=". It also will have a prefix of
// "tel:" added, e.g. "tel:+41-44-668-1800".
enum PhoneNumberFormat {
E164,
INTERNATIONAL,


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

@ -380,12 +380,13 @@ public class PhoneNumberUtil {
/**
* INTERNATIONAL and NATIONAL formats are consistent with the definition in ITU-T Recommendation
* E123. For example, the number of the Google Switzerland office will be written as
* "+41 44 668 1800" in INTERNATIONAL 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
* separating symbols replaced with a hyphen, and with any phone number extension appended with
* ";ext=". It also will have a prefix of "tel:" added, e.g. "tel:+41-44-668-1800".
* E.123. However we follow local conventions such as using '-' instead of whitespace as
* separators. For example, the number of the Google Switzerland office will be written as
* "+41 44 668 1800" in INTERNATIONAL 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 separating symbols
* replaced with a hyphen, and with any phone number extension appended with ";ext=". It also
* will have a prefix of "tel:" added, e.g. "tel:+41-44-668-1800".
*
* Note: If you are considering storing the number in a neutral format, you are highly advised to
* use the PhoneNumber class.


+ 9
- 8
javascript/i18n/phonenumbers/phonenumberutil.js View File

@ -883,14 +883,15 @@ i18n.phonenumbers.PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY = '001';
/**
* INTERNATIONAL and NATIONAL formats are consistent with the definition in
* ITU-T Recommendation E123. For example, the number of the Google Switzerland
* office will be written as '+41 44 668 1800' in INTERNATIONAL 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 separating symbols
* replaced with a hyphen, and with any phone number extension appended with
* ';ext='. It also will have a prefix of 'tel:' added, e.g.
* 'tel:+41-44-668-1800'.
* ITU-T Recommendation E123. However we follow local conventions such as
* using '-' instead of whitespace as separators. For example, the number of the
* Google Switzerland office will be written as '+41 44 668 1800' in
* INTERNATIONAL 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 separating symbols replaced with a hyphen, and with any phone
* number extension appended with ';ext='. It also will have a prefix of 'tel:'
* added, e.g. 'tel:+41-44-668-1800'.
*
* Note: If you are considering storing the number in a neutral format, you are
* highly advised to use the PhoneNumber class.


Loading…
Cancel
Save