rust-phonenumber icon indicating copy to clipboard operation
rust-phonenumber copied to clipboard

00-prefixed international numbers don't parse

Open rubdos opened this issue 4 years ago • 2 comments

let n = "0032474123456";
assert!(phonenumber::parse(None, n).is_ok());

I would expect this to yield +32474123456, but it seemingly does not: it yields InvalidCountryCode (which could've parsed as Belgium instead).

rubdos avatar Nov 20 '20 17:11 rubdos

This matches the behavior of the official Google libphonenumber Java library.

I will investigate it anyway as it seems a bit strange.

On Fri, Nov 20, 2020, 18:49 Ruben De Smet [email protected] wrote:

let n = "0032474123456";assert!(phonenumber::parse(None, n).is_ok());

I would expect this to yield +32474123456, but it seemingly does not: it yields InvalidCountryCode (which could've parsed as Belgium instead).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rustonaut/rust-phonenumber/issues/29, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2HJEILTRPIODFRZQIPFP3SQ2T2XANCNFSM4T5CJ76A .

rustonaut avatar Nov 20 '20 20:11 rustonaut

And the Google libphonenumber demo rejected my own phone number..., Definitely something strange going one there.

On Fri, Nov 20, 2020, 21:09 Philipp Korber [email protected] wrote:

This matches the behavior of the official Google libphonenumber Java library.

I will investigate it anyway as it seems a bit strange.

On Fri, Nov 20, 2020, 18:49 Ruben De Smet [email protected] wrote:

let n = "0032474123456";assert!(phonenumber::parse(None, n).is_ok());

I would expect this to yield +32474123456, but it seemingly does not: it yields InvalidCountryCode (which could've parsed as Belgium instead).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rustonaut/rust-phonenumber/issues/29, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2HJEILTRPIODFRZQIPFP3SQ2T2XANCNFSM4T5CJ76A .

rustonaut avatar Nov 20 '20 20:11 rustonaut