Skip to content

Phonelib.parse Fails to Identify Country for Brazilian Numbers Without "+" Prefix #326

@geraldaddey

Description

@geraldaddey

Description

 
When parsing a Brazilian phone number without the + prefix, the Phonelib.parse method does not correctly identify the country. However, adding the + prefix works as expected.

require 'phonelib'

Phonelib.parse('554197520226').country

=> nil

Phonelib.parse('+554197520226').country

=> "BR"

Expected Behavior

The method should correctly identify the country as Brazil ("BR") regardless of whether the number is prefixed with +.

Actual Behavior

The method returns nil when the + prefix is omitted.

 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions