ttacon/libphonenumber

AR numbers -- weird behaviour with transformation rule

Closed this issue · 0 comments

An AR number such as "+541151123456" is not parsed correctly and is thus deemed invalid by the go lib.

The transform rule is badly applied in maybeStripNationalPrefixAndCarrierCode: it originates from the subgroup logic in this function.

I have a fix ready for this, will PR soon.

$ go test
--- FAIL: TestARNumberTransformRule (0.00s)
phonenumberutil_test.go:730: Number country_code:54 national_number:9191919293 should be valid for region AR
phonenumberutil_test.go:734: Expected '+541151123456', got '+549191919293'
FAIL
exit status 1