phoney icon indicating copy to clipboard operation
phoney copied to clipboard

Where is the country data in a human readable format?

Open g1smd opened this issue 11 years ago • 5 comments

I had intended to update the phone number patterns for GB/UK in /lib/data/regions.yml with some recent changes, but the file has been deleted.

I understand the project uses data in the binary file /lib/data/regions.bin now, but where does the data within that file come from?

I believe the data is possibly converted to the binary format using a utility, but I cannot find an editable file with the source data. Is it in a separate project?

g1smd avatar May 10 '13 07:05 g1smd

I found the file /resources/new_regions.yml in the commit history but cannot see that file in the current project.

g1smd avatar May 10 '13 07:05 g1smd

There is resources/Default.phoneformat, which is a HEX-file from the iPhone SDK. So if a number does not format the same as the iPhone does it, then it can be considered a bug!

There is also a file that converts this file into yml and some rake tasks that do that.

Try bundle exec rake phoney:generate_regions_yml FILE=resources/Default.phoneformat > regions.yml

haberbyte avatar May 10 '13 07:05 haberbyte

However, I would really like to know if the iPhone formats the numbers correctly! Because i would like to update the regions based off that.

Or is there recent changes in the numbering plan and they're not even considered on iOS devices?

If that is the case i should probably check the YML source file into version control, so people can modify that more easily.

haberbyte avatar May 10 '13 08:05 haberbyte

I believe the iPhone is mostly correct for GB/UK phone numbers. However, I find it easier to look down a list of ranges and formats for completeness.

There are shortly going to be some changes to the designations for 084 and 087 numbers in the UK.

I'm also not entirely sure if several recently introduced number ranges are already catered for because the formatting rules were already more generalised from the start, or whether those newer number ranges need to be explicitly added.

Yes, please add the other file.

g1smd avatar May 10 '13 08:05 g1smd

Several 071xx prefixes are just coming into use for mobile phones in GB.

It is likely that 073xx will also come into use later in the year.

I'm not sure if GB mobiles are currently hard coded as 7([45789]\d{2}|624)\d{6} or as 7([1-5789]\d{2}|624)\d{6}.

g1smd avatar May 21 '13 15:05 g1smd