Skip to content

Commit 48a3aee

Browse files
Docs update (google#2792)
* Fixing anchors Co-authored-by: penmetsaa <[email protected]>
1 parent bbbf17b commit 48a3aee

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

FAQ.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Frequently Asked Questions (FAQ)
22

3-
## <a href="#parsing"/>Parsing
3+
## <a href="#parsing">Parsing</a>
44

5-
### <a href="#country_code_not_removed"/>Why wasn't the country code removed when parsing?
5+
### <a href="#country_code_not_removed">Why wasn't the country code removed when parsing?</a>
66

77
In some cases, the library cannot tell if the leading digits of a phone number
88
are intended to be the country calling code, or the start of the national
@@ -18,7 +18,7 @@ If you know that your numbers are always in the form &lt;country calling
1818
code&gt;&lt;national significant number&gt;, it is safe to put a "+" in front to
1919
indicate this to the library.
2020

21-
### <a href="#non_digits"/>Why does the library treat some non-digit characters as digits?
21+
### <a href="#non_digits">Why does the library treat some non-digit characters as digits?</a>
2222

2323
When parsing, the library does its best to extract a phone number out of the
2424
given input string. It looks for the phone number in the provided text; it
@@ -52,7 +52,7 @@ Other examples, in reports:
5252
* [#1199](http://github.com/google/libphonenumber/issues/1199)
5353
* [#1813](http://github.com/google/libphonenumber/issues/1813)
5454

55-
### <a href="#prefix_not_removed"/>Why wasn't the national prefix removed when parsing?
55+
### <a href="#prefix_not_removed">Why wasn't the national prefix removed when parsing?</a>
5656

5757
Usually, when parsing, we remove a country's national or trunk prefix, so we can
5858
store a normalized form of the number. This is usually, but not always, a
@@ -72,7 +72,7 @@ part of the national number:
7272
when formatting since other short-codes do not, and we would be irreparably
7373
changing the phone number.
7474

75-
### <a href="#parsing_idds"/>Why wasn't `00` parsed the same as `+`?
75+
### <a href="#parsing_idds">Why wasn't `00` parsed the same as `+`?</a>
7676

7777
`00` is not an international prefix (IDD) in every region, so it's not
7878
equivalent to `+`.
@@ -91,22 +91,22 @@ You can try [the demo](http://libphonenumber.appspot.com/) for more regions.
9191
Also see `internationalPrefix` in
9292
[`resources/PhoneNumberMetadata.xml`](http://github.com/google/libphonenumber/blob/master/resources/PhoneNumberMetadata.xml).
9393

94-
## <a href="#validation"/>Validation and types of numbers
94+
## <a href="#validation">Validation and types of numbers</a>
9595

96-
### <a href="#possible_vs_valid"/>What is the difference between isPossibleNumber and isValidNumber?
96+
### <a href="#possible_vs_valid">What is the difference between isPossibleNumber and isValidNumber?</a>
9797

9898
To understand the behavior of functions, please refer to the documentation in
9999
the Javadoc/C++ header files. For example, see `isPossibleNumberWithReason` in
100100
[`PhoneNumberUtil`](https://github.com/google/libphonenumber/blob/master/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java).
101101

102-
### <a href="#short_numbers"/>Why does PhoneNumberUtil return false for valid short numbers?
102+
### <a href="#short_numbers">Why does PhoneNumberUtil return false for valid short numbers?</a>
103103

104104
Short numbers are out of scope of
105105
[`PhoneNumberUtil`](https://github.com/google/libphonenumber/blob/master/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java).
106106
For short numbers, use
107107
[`ShortNumberInfo`](https://github.com/google/libphonenumber/blob/master/java/libphonenumber/src/com/google/i18n/phonenumbers/ShortNumberInfo.java).
108108

109-
### <a href="#what_is_valid"/>What does it mean for a phone number to be valid?
109+
### <a href="#what_is_valid">What does it mean for a phone number to be valid?</a>
110110

111111
Our phone number library can tell that a number range is valid when there is
112112
sufficient official documentation, with some latency after this fact is brought
@@ -122,7 +122,7 @@ phone call with a verification code). This is not technically feasible without
122122
such a verification step given the complicated international world we live in,
123123
with varying standardization practices in different regions.
124124

125-
#### <a href="#why_not_valid"/>But my dialled number connected, so isn't it valid?
125+
#### <a href="#why_not_valid">But my dialled number connected, so isn't it valid?</a>
126126

127127
Not necessarily.
128128

@@ -135,7 +135,7 @@ Not necessarily.
135135
US are not valid, because without the rest of the number it is impossible
136136
for the library to canonicalize this.
137137

138-
### <a href="#isvalidnumberforregion"/>When should I use isValidNumberForRegion?
138+
### <a href="#isvalidnumberforregion">When should I use isValidNumberForRegion?</a>
139139

140140
Rarely! Many people have phone numbers that do not belong to the country they
141141
live in. This applies particularly to mobile numbers, but may also be true
@@ -149,7 +149,7 @@ One use-case where this method may be useful is if you want to see if a
149149
`FIXED_LINE` number for a business matches the country it is in, to try and spot
150150
data errors.
151151

152-
### <a href="#incorrect_formatting"/>Some "valid" numbers are not formatting correctly.
152+
### <a href="#incorrect_formatting">Some "valid" numbers are not formatting correctly.</a>
153153

154154
This could be due to number simplification. In order to keep the size of the XML
155155
files to a reasonable level, it's necessary in some regions (e.g. "DE" or "AT")
@@ -167,27 +167,27 @@ information to cover these numbers as well, it's a rather non-trivial task
167167
valid ranges with different formats). Note that this also applies to attributes
168168
like "national only" or geocoding information.
169169

170-
### <a href="#sms_sending"/>What types of phone numbers can SMSs be sent to?
170+
### <a href="#sms_sending">What types of phone numbers can SMSs be sent to?</a>
171171

172172
SMSs can be sent to `MOBILE` or `FIXED_LINE_OR_MOBILE` numbers. However,
173173
in some countries it is possible to configure other types, such as normal
174174
land-lines, to receive SMSs.
175175

176-
### <a name="#fixed_line_or_mobile"/>Why did I get `FIXED_LINE_OR_MOBILE` as the type of my phone number?
176+
### <a name="#fixed_line_or_mobile">Why did I get `FIXED_LINE_OR_MOBILE` as the type of my phone number?</a>
177177

178178
Some number ranges are explicitly defined as being for fixed-line or mobile
179179
phones. We even represent ranges defined as being "Mostly land-line" in this
180180
way.
181181

182-
### <a name="#portability"/>What is mobile number portability?
182+
### <a name="#portability">What is mobile number portability?</a>
183183

184184
The ability to keep your mobile phone number when changing carriers. To see whether a region supports mobile number portability use [isMobileNumberPortableRegion](https://github.com/google/libphonenumber/blob/58247207903f917839001bc62525a5b48a475b7e/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3524).
185185

186-
### <a name="#carrier_changes"/>Since it's possible to change the carrier for a phone number, how is the data kept up-to-date?
186+
### <a name="#carrier_changes">Since it's possible to change the carrier for a phone number, how is the data kept up-to-date?</a>
187187

188188
Not all regions support mobile number portability. For those that don't, we return the carrier when available. For those that do, we return the original carrier for the supplied number.
189189

190-
### <a name="#m2m"/>What about M2M (machine to machine) numbers?
190+
### <a name="#m2m">What about M2M (machine to machine) numbers?</a>
191191

192192
libphonenumber does not support M2M numbers in general, but only in one exception case where in Netherlands 097X M2M numbers are used as regular mobile phone numbers.
193193

@@ -201,14 +201,14 @@ Many people use this library for formatting the numbers of their contacts, for a
201201

202202
At the moment Libphonenumber can only support phone numbers that can be dialled by us, not by machines. If you found any humanly diallable M2M numbers that library is not supporting, please raise an [issue here](http://issuetracker.google.com/issues/new?component=192347) with all authoritative and specific documentation such as government sources, which have varied definitions.
203203

204-
### <a href="#why_only_nl_m2m"/>Why supporting only NL M2M numbers?; Are we sure all 097X numbers are MOBILE?
204+
### <a href="#why_only_nl_m2m">Why supporting only NL M2M numbers?; Are we sure all 097X numbers are MOBILE?</a>
205205

206206
Official authority has [explicitly stated](https://www.acm.nl/en/publications/information-about-dutch-097-numbers-non-dutch-providers) that this range “should be made accessible, just like other, regular number series from the Netherlands” and that “you can set up a voice and SMS connection towards prefix +31-97 in the same way as you have done already with the +31-6 series.[...] you should enable your systems for voice telephony for the numbers
207207
in the +31-97 series”. This means, however, that there might be cases where the library would categorise a number as a valid mobile number, but in reality, the particular number is used as pure M2M, is not SMS or voice-enabled. There is not much we can do from our side about this, since we always follow official guidelines.
208208

209209
Therefore, clients should be aware that there is possibility of false positives in NL MOBILE category. The library will continue to not support M2M numbers in general.
210210

211-
### <a href="#operator_specific_numbers"/>What about numbers that are only valid for a set of subscribers?
211+
### <a href="#operator_specific_numbers">What about numbers that are only valid for a set of subscribers?</a>
212212

213213
There are some numbers that only work for the subcribers of certain operators
214214
for special operator-specific services. These differ from carrierSpecific since
@@ -223,19 +223,19 @@ similar to our prerequisites for supporting M2M.
223223
Please see [this issue](https://issuetracker.google.com/issues/65238929) for more
224224
context, and file a new issue if you're able to provide more information than this.
225225

226-
## <a name="#representation"/>Representation
226+
## <a name="#representation">Representation</a>
227227

228-
### <a name="#max_length"/>What is the maximum and minimum length of a phone number?
228+
### <a name="#max_length">What is the maximum and minimum length of a phone number?</a>
229229

230230
We support parsing and storing numbers from a minimum length of two digits to a
231231
maximum length of 17 digits currently (excluding country calling code). The ITU
232232
standard says the national significant number should not be longer than
233233
fifteen digits, but empirically this has been proven not to be followed by all
234234
countries.
235235

236-
## <a name="#formatting"/>Formatting
236+
## <a name="#formatting">Formatting</a>
237237

238-
### <a name="#language_specific_format"/>Can / should we format phone numbers in a language-specific way?
238+
### <a name="#language_specific_format">Can / should we format phone numbers in a language-specific way?</a>
239239

240240
No, phone number formatting is country-specific and language-independent. E.g.
241241
formatting a US number in a French way (e.g. the way a France number is
@@ -245,7 +245,7 @@ It is true that in some countries phone numbers are typically written using
245245
native, not ASCII, digits; our phone number library supports parsing these but
246246
doesn't support it at formatting time at the moment.
247247

248-
### <a href="#changes_in_formatting"/>When does formatting in a country change?
248+
### <a href="#changes_in_formatting">When does formatting in a country change?</a>
249249

250250
The formatting within a country changes sparingly, but may be announced explicitly
251251
or noted implicitly in a national numbering plan update that introduces a new number
@@ -268,7 +268,7 @@ parentheses persists and both methods are acceptable.
268268
See [issue #1996](https://github.com/google/libphonenumber/issues/1996)
269269
for some additional discussion.
270270

271-
### <a name="#empty_format_result"/>Why does formatNumberForMobileDialing return an empty string for my number?
271+
### <a name="#empty_format_result">Why does formatNumberForMobileDialing return an empty string for my number?</a>
272272

273273
If we don't think we can guarantee that the number is diallable from the user's
274274
mobile phone, we won't return anything. This means that for numbers that we
@@ -279,17 +279,17 @@ time then we will return an empty string. If you get an empty string and are
279279
okay providing a number that may not be diallable, you can call another of our
280280
formatting numbers instead.
281281

282-
## <a name="#metadata"/>Metadata
282+
## <a name="#metadata">Metadata</a>
283283

284-
### <a name="#metadata_definition"/>What do we mean by "metadata"?
284+
### <a name="#metadata_definition">What do we mean by "metadata"?</a>
285285

286286
We use the word "metadata" to refer to all information about phone numbering in
287287
a particular country - what the country code, international and national
288288
dialling prefixes are, what carrier codes are operational, which phone numbers
289289
are possible or valid for a particular country, how to optimally format them,
290290
which prefixes represent a particular geographical area, etc.
291291

292-
### <a name="#metadata_sources"/>Where do we get information from to determine if a number range is valid?
292+
### <a name="#metadata_sources">Where do we get information from to determine if a number range is valid?</a>
293293

294294
In theory, phone numbering plans are all supposed to be administered through the
295295
ITU. Many countries' phone numbering plans may be found on the [ITU website](
@@ -316,7 +316,7 @@ We'd love to consume machine-readable numbering plan data (assigned ranges,
316316
carrier & geo mappings). If you can connect us with partners in the industry
317317
to achieve this, please do so. Thanks!
318318

319-
### <a name="#mx_and_ar"/>Why is this number from Argentina (AR) or Mexico (MX) not identified as the right number type?
319+
### <a name="#mx_and_ar">Why is this number from Argentina (AR) or Mexico (MX) not identified as the right number type?</a>
320320

321321
Certain countries' mobile and/or fixed line ranges may overlap or too granular,
322322
which may make accurate identification impossible. Eg: Argentina and Mexico.
@@ -371,7 +371,7 @@ mobile numbers internatioanlly, fixed-line to mobile nationally.. As these
371371
dialling patterns were deprecated, we have continued to maintain mobile and
372372
fixed-line ranges at higher level, returning type as [`FIXED_LINE_OR_MOBILE`](#fixed_line_or_mobile)
373373

374-
### <a href="#mx_legacy_formats"/>Why Mexico (MX) numbers in older dialling formats are accepted as valid ones?
374+
### <a href="#mx_legacy_formats">Why Mexico (MX) numbers in older dialling formats are accepted as valid ones?</a>
375375
Though library has stopped supporting below older dialling codes in the canonical
376376
form and formatting results, we are lenient in parsing the number, i.e removing
377377
all older codes.
@@ -382,7 +382,7 @@ This is because we found the older dialling codes supported even after deprecati
382382
period, so we decided to support them for longer time. However, we will stop this as
383383
part of [this issue](https://issuetracker.google.com/issues/205606725). More details there.
384384

385-
### <a name="#unsupported_regions"/>Why are Bouvet Island (BV), Pitcairn Island (PN), Antarctica (AQ) etc. not supported?
385+
### <a name="#unsupported_regions">Why are Bouvet Island (BV), Pitcairn Island (PN), Antarctica (AQ) etc. not supported?</a>
386386

387387
We only support a country if:
388388

@@ -417,7 +417,7 @@ calling codes that are only "reserved", or that no data is available for (namely
417417
a proposed new international telecommunication public correspondence service,
418418
shared code".)
419419

420-
### <a name="#indonesia_tollfree"/>Why are Indonesian toll-free numbers beginning with "00x 803" not supported?
420+
### <a name="#indonesia_tollfree">Why are Indonesian toll-free numbers beginning with "00x 803" not supported?</a>
421421

422422
Although some numbers beginning with "001 803" or "007 803" do work in Indonesia
423423
to reach toll-free endpoints, these numbers are hard to support because they
@@ -435,9 +435,9 @@ section, and it is likely some changes in the parsing code would have to be
435435
made to interpret the "00x" as something other than an IDD: this could have
436436
undesirable side-effects when parsing other numbers.
437437

438-
## <a name="#misc"/>Misc
438+
## <a name="#misc">Misc</a>
439439

440-
### <a name="#reduced_metadata"/>What is the metadatalite.js/METADATA_LITE option?
440+
### <a name="#reduced_metadata">What is the metadatalite.js/METADATA_LITE option?</a>
441441

442442
For JavaScript, Java and C++ there is the option to use a stripped-down version
443443
of the metadata. Currently this only removes the example number metadata, so the
@@ -462,7 +462,7 @@ The metadata binary files can be generated using the ant build rules
462462
file](https://github.com/google/libphonenumber/blob/master/java/build.xml)
463463
itself.
464464

465-
### <a name="#maven"/>Which versions of the Maven jars should I use?
465+
### <a name="#maven">Which versions of the Maven jars should I use?</a>
466466

467467
When possible, use the [latest
468468
version](https://github.com/google/libphonenumber/releases) of
@@ -482,7 +482,7 @@ version of libphonenumber, follow these steps:
482482
* If you depend on the carrier or geocoder jar, you also need to depend on
483483
the prefixmapper jar.
484484

485-
### <a name="#android"/>How do I load libphonenumber resources in my Android app?
485+
### <a name="#android">How do I load libphonenumber resources in my Android app?</a>
486486

487487
#### System considerations
488488

@@ -525,7 +525,7 @@ You also need to copy the binary metadata files into your app's asset directory,
525525
automate updating them from upstream. To avoid net increase of app size, remove them
526526
from libphonenumber.
527527

528-
### <a name="#windows"/>What about Windows?
528+
### <a name="#windows">What about Windows?</a>
529529

530530
The libphonenumber team's support of the C++ library on Windows is primarily to
531531
support Chromium's build environment, and we depend on the community to support
@@ -545,7 +545,7 @@ group](https://groups.google.com/group/libphonenumber-discuss):
545545
* [#1555](https://github.com/google/libphonenumber/issues/1555) to allow
546546
Windows to build cpp library with pthreads for multi-threading
547547

548-
### <a name="#remove_example_number"/>How to remove a specific example number
548+
### <a name="#remove_example_number">How to remove a specific example number</a>
549549

550550
We supply example numbers as part of the library API. While we aim to have numbers
551551
that are either explicitly allocated by the country as a test number, or look
@@ -556,7 +556,7 @@ If we by chance have actually listed your real number and would like it removed,
556556
please report this through Google's new [Issue Tracker](http://issuetracker.google.com/issues/new?component=192347).
557557
Only our internal team will have access to your identity (whereas GitHub usernames are public).
558558

559-
### Why can the smallest digits of parsed numbers that are very long be incorrect when parsing in Javascript?
559+
### <a name="#long_numbers_in_js">Why can the smallest digits of parsed numbers that are very long be incorrect when parsing in Javascript?</a>
560560

561561
Eg: National number of 900184080594493**87**, ```region: JP``` is parsed as
562562
900184080594493**90**. Reason: When the provided number is more than the max

0 commit comments

Comments
 (0)