Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valid phone numbers are not accepted #13

Closed
wichert opened this issue Jul 1, 2015 · 2 comments
Closed

Valid phone numbers are not accepted #13

wichert opened this issue Jul 1, 2015 · 2 comments

Comments

@wichert
Copy link

wichert commented Jul 1, 2015

As an experiment I tried to validate +31101234567. Testing this against the libphonenumber demo shows that it should be flagged as a correct number. When I run this against the golang version I get the following:

Number: country_code:31 national_number:1234567 
Region code: NL
Number is valid: false
    number, err := libphonenumber.Parse(phone, "MY")
    if err != nil {
        log.Printf("Invalid: %v", err.Error())
        return false
    }
    log.Printf("Number: %v", number)
    log.Printf("Region code: %v", libphonenumber.GetRegionCodeForNumber(number))
    log.Printf("Number is valid: %v", libphonenumber.IsValidNumber(number))

It looks like the area code (010) was lost somewhere.

@ttacon
Copy link
Owner

ttacon commented Jul 1, 2015

Ya, I currently think there might be a metadata issue that needs to be looked into (possibly related to #7 ). I don't have a ton of time at the moment (day job and all) but when I do I'm planning to get around to this.

loopfz pushed a commit to loopfz/libphonenumber that referenced this issue Aug 20, 2015
ttacon added a commit that referenced this issue Aug 22, 2015
Fixes issues #7, #10, #13. Prefix matching related (java equivalent == LookingAt() )
@ttacon
Copy link
Owner

ttacon commented Aug 22, 2015

This has been fixed by #14

@ttacon ttacon closed this as completed Aug 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants