Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Local phone number formatting issue #22

Open
futuretap opened this issue Jul 23, 2014 · 4 comments
Open

Local phone number formatting issue #22

futuretap opened this issue Jul 23, 2014 · 4 comments

Comments

@futuretap
Copy link

The national_format returns wrong results in many cases:

GlobalPhone.parse('+4372762580').national_format
=> "0727  62580"

(correct: 07276 2580)

GlobalPhone.parse('+49907896890').national_format
=> "090  7896890"

(correct: 09078 96890)

I think that the problem is not caused by wrong rules in the DB since libPhoneNumber-iOS yields correct results.

@wallymathieu
Copy link

Look at pull request #9

@futuretap
Copy link
Author

I didn't mean the double white space which is easy to fix. I meant the wrong position of the space.

@locochris
Copy link
Contributor

@futuretap - confirmed using a freshly created global_phone.json (even with the whitespace fix of #9).

I've never tried to understand how the json is being generated, but perhaps there's some information lost when parsing the original xml. I notice a bit of a difference in size (even taking in to account comments and xml bloat).

diff -u <({curl -silent http://libphonenumber.googlecode.com/svn/trunk/resources/PhoneNumberMetadata.xml, global_phone_dbgen} | wc -l)
-   24710
+    6659

@wallymathieu
Copy link

You could look at the c# port. I've modified the code to generate a bit more readable json : GlobalPhone/GlobalPhone@6eb4eb5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants