phonelib icon indicating copy to clipboard operation
phonelib copied to clipboard

Australian landline numbers beginning with 08.

Open thomashexton opened this issue 3 years ago • 1 comments

Thank you for a great gem. It's got my back a lot, but I've been unsuccessful in finding a solution to my following issue. And to be honest, I'm not able to work out if it's a bug in phonelib or something related to Google's libphonenumber? (And if it is the latter, I've also been unsuccessful in finding some docs to explain how to overwrite the libphonenumner locally, as this Gem's README specifies I can do (via Phonelib.override_phone_data method).

From my testing, all of the Australian landline state prefix codes 02, 03, 04, 07 (as defined by Government) work except for the 08 prefix.

Working AUS code example: ✅

Phonelib.parse("(07) 4444 0008").national
> "(07) 4444 0008"
Phonelib.parse("(07) 4444 0008").e164
>  "+61744440008"

Broken AUS code example: ❌

Phonelib.parse("(08) 4444 0008").national
> "844440008"
Phonelib.parse("(08) 4444 0008").e164
> "+610844440008" # please note: additional 0 just after the +61

Any help would be appreciated.

thomashexton avatar Apr 22 '22 02:04 thomashexton

@thomashexton I updated data of the gem, but it's still being parsed incorrectly. Check section describing parsing issue. You can open issue for libphonenumber or just add additional regexes for AUS in initializer.

daddyz avatar Jun 08 '22 04:06 daddyz