Repository navigation
Releases: landrix/libphonenumber-pascal
Release list
9.0.42.0
libphonenumber-pascal 9.0.42.0: metadata refresh to upstream
libphonenumber 9.0.42.
Upstream changed no code in the ported classes between 9.0.41 and 9.0.42, so
this release changes the data only; the API and the behaviour of the port are
the same as in 9.0.41.0.
Metadata changes
- AU, CC, CX: mobile ranges 496[0-4] added.
- AX, FI: mobile range 4946 removed.
- BW: fixed line and mobile ranges rewritten, the separate VoIP range
(79...) removed, national formats adjusted; short numbers rewritten
(lengths 3 to 5). - CN: fixed line, shared cost and national formats reworked.
- CO: mobile ranges regrouped (9101 removed); short numbers:
carrier specific and SMS services take six digit codes. - CR: fixed line 20 narrowed to 2010; VoIP 200[0-3] added.
- CV: mobile 57 added. DK: 37 removed from mobile and fixed line.
- ES: mobile 59010[0-2] and 590600 removed.
- GH: fixed line ranges reworked. GY: fixed line 516, mobile 768 and
781 added. - IN: fixed line 796 removed, some mobile ranges and formats changed.
- KE: mobile 13[5-9] and 146 added. KW: mobile 5999 added.
- PG: VoIP 206 added. PY: mobile 9881 added.
- RU: part of mobile 93 removed. SH: mobile 9 added.
Details in the
CHANGELOG.
Verification
Generated from the upstream XML at tag v9.0.42; checked against the C# port
libphonenumber-csharp 9.0.42 over every example number of the metadata with
no differences; the test suite, the samples and the Delphi / FreePascal
runtime comparison pass on Delphi and FreePascal.
Upgrading
Replace your copy of src/. Numbers in the ranges above may now validate,
type or format differently - that is the upstream data change, not a change
of the port.
9.0.41.0
libphonenumber-pascal 9.0.41.0: the pure Object Pascal port of Google's
libphonenumber for Delphi and
FreePascal, built from upstream metadata release 9.0.41.
New version scheme
From this release on, the version names the upstream metadata release it is
built from, plus a fourth part for releases of the port alone:
| version | meaning |
|---|---|
X.Y.Z.0, e.g. 9.0.42.0 |
the first release on upstream metadata X.Y.Z |
X.Y.Z.1, X.Y.Z.2, ... |
fixes or features of the port, metadata unchanged |
The first release, 0.1.0, predates the scheme and already carried metadata
9.0.41; 9.0.41.0 is the first release under the scheme and contains
everything since.
What is new since 0.1.0
- The facade takes a parsed number, as upstream does:
TPhoneNumberUtil.IsValidNumber(Number),IsValidNumberForRegion,
GetNumberType,GetRegionCodeForNumber,IsPossibleNumber,
IsPossibleNumberWithReason,IsPossibleNumberForType(WithReason)and
CanBeInternationallyDialled. - Two parse driver steps are public
(MaybeStripInternationalPrefixAndNormalize,TryMaybeExtractCountryCode),
and the two upstream tests that call them are ported. - Fixes, both toward upstream behaviour: an empty international prefix is a
zero length match (affects only territories without one: the
non-geographical entities and CO of the upstream test metadata; production
parse results are unchanged); the regex layer rejects a caller pattern that
would break out of its internal wrapping (e.g.)|(), like
java.util.regexdoes. - Documentation: a new user guide
(installation for Delphi and Lazarus, every task with examples, a Java/C# to
Pascal mapping, FAQ), a README written for users, and
samples- one small program per task, each with an expected output that CI checks
on Delphi and FreePascal.
- one small program per task, each with an expected output that CI checks
- Tooling: the FreePascal gates also run on FreePascal 3.2.2 by default,
and a weekly job opens an issue when upstream publishes a new release.
The full list is in the
CHANGELOG.
Compatibility
Every 0.1.0 call still compiles; the new overloads only add to the API. With
the production metadata, results are unchanged. The one behaviour change is
for malformed regular expressions a caller passes in (for example a user
format of FormatByPattern): a pattern that breaks out of the wrapping is now
rejected like any other compile error instead of matching. Delphi 13 (Win64) and FreePascal 3.2.2, 3.2.4
and 3.3.1 are tested.
0.1.0
First release of libphonenumber-pascal: a pure Object Pascal port of Google's
libphonenumber for Delphi and
FreePascal, built from upstream metadata release 9.0.41.
No DLL, no .NET, no external runtime: the upstream metadata is generated into
Pascal units and compiled in.
What is in it
PhoneNumberUtil: parsing (RFC3966, extensions, Unicode digits, vanity
numbers), possible / valid checks, number type, region lookup, every
format*method,isNumberMatch, example numbers and the accessory API.AsYouTypeFormatter,ShortNumberInfoandPhoneNumberMatcher
(findNumbers, all four leniency levels) - complete.- A metadata generator that ports upstream
BuildMetadataFromXml.java; a
metadata update is a regeneration, never a hand edit. - Not ported: geocoder, carrier mapper, time zone mapper.
Tested configurations
- Delphi 13, Win64.
- FreePascal in
{$MODE DELPHI}: 3.2.2, 3.2.4 and 3.3.1 on Linux aarch64;
3.3.1 on Windows aarch64; 3.2.4 on macOS aarch64; 3.2.2 on Linux x86_64
(CI). - On FreePascal, non ASCII input needs
SetMultiByteConversionCodePage(CP_UTF8)
and, on Unix,cwstringin the program; see
README, FreePascal.
How correctness is established
- Tests ported from the four upstream test classes run against the upstream
test metadata with the Java expected values:PhoneNumberUtilTest115 of
121,PhoneNumberMatcherTest45 of 46,ShortNumberInfoTestand
AsYouTypeFormatterTestcomplete. The few unported methods test private
parse steps, a metadata loader that can fail, proto fields the port does
not model, orIterator.remove()
(KNOWN_ISSUES.md). - One test suite (555 tests) runs unchanged on Delphi and on FreePascal.
- Production tests take their expected values from the C# port
libphonenumber-csharp9.0.41; where it differs from the Java original
(mostly in the matcher), Java wins and the case is pinned as a documented
divergence. - Mass differential against that C# port: all 1144 example numbers of the
metadata x 9 answers (parse, four formats, possible, valid, type, region),
0 findings. - A FreePascal runtime gate checks that a Delphi build and a FreePascal build
of one driver produce byte identical output over a fixed regression corpus
(every example number, short number, as-you-type sequence and matcher text,
every compiled metadata pattern, and more).
See the
README
for usage and the
CHANGELOG
for the full list. Wrong number data is almost always an upstream metadata
issue; see
CONTRIBUTING.md.