LibPhoneNumbr (Google)

google/libphonenumber last check 239 releases
Notes

Google's common Java, C++ and JavaScript library for parsing, formatting, and validating international phone numbers.

<dependency>
  <groupId>com.googlecode.libphonenumber</groupId>
  <artifactId>libphonenumber</artifactId>
  <version>9.0.32</version>
</dependency>
Release notes
view on github
8.6.0 · 1y+

Hi all,

Please find the new JARs on the maven site here.

The new release contains metadata changes and some code changes. Upgrading to the latest release is always encouraged since phone number information changes often!

New functionality in this release:

  • Added a new enum for CountryCodeSource called UNSPECIFIED. This is used as a default value, and will be returned if someone calls parse() and then getCountryCodeSource() on the result. If users want an actual value for this then they should call parseAndKeepRawInput() instead; the values that were previously returned after calling this method will not change.

Changes affecting porters:

  • leading_zero_possible was removed from the metadata and all the places it is referenced in the build and prod code. This will be removed from the metadata proto itself in a subsequent release. This should not affect users of the library - the only place it was used was FormatInOriginalFormat, and only initially to try and avoid modifying the input number by removing/adding digits inadvertently. Now this is checked at the end of the method anyway. However slight formatting differences with this method on invalid numbers starting with 0s may be noticed in some countries.
  • The possible number pattern has been deleted from the phonemetadata.proto file and all generated code. This has not been used for a long time.

Full details in the release notes.

Note if you take advantage of this new functionality by changing your code, it will not necessarily be trivially easy to roll back to a previous version.

Thanks to all those who contributed by providing issue reports!

Want to be notified of future releases? Join the discussion group!