Hacker News new | past | comments | ask | show | jobs | submit login

It is all just extremely confusing if you stare at the examples as I am pretty sure there can't be a country code +12... that would get parsed as +1. So, that first one is actually +1(234)567-8901 ;P.



Obviously no country code can be a prefix of another one. The switches would not know how to interpret it.

But 2 or more countries can use the same country code. The area code will determine which country you call to.

In the North American numbering plan +1 all numbers must have a fixed length 3 + 3 + 4.

In many other numbering plans the length varies. Both area code length and subscriber number length can vary. So it gets pretty complicated to parse a number. Basically rules don't help, you need a database and you need to update it regularly. No idea whether an open, non-commercial data set exists.

When I call to Germany Android shows the name of pretty small places. I believe Android reports every number you call to Google. But the database is probably still local, I believe locations are also shown when you have no data connection.

I am not from the US, but I understood there you might also need extensions to be dialled after the number proper.


The way the system used to be in the USA, area codes only had 0 or 1 in middle of it. So only +120 & +121 would do USA until they shifted in 1995 to have USA area codes w other numbers in the middle. I'll guess any of those little islands only get subsets of the number space to maintain comparability. Once I almost got ripped off fromthis, someone called an adult number w a domestic area code that went to Guyana in South America. I had American Long Lines block all foreign and all pay numbers, they knew if was a foreign porn number and tried to get their cut. I refused as they knew it was international and worse they knew it was porn. I knew to block as my roommate was still in college and I assumed issues would arise with out those blocks.


There's no +1234 (you'll end up in a number block allocated for Ohio), but other +12* numbers can go international. +1242 will end up in the Bahamas and +1246 is the international dialing code for Barbados. A bunch of Caribbean islands are part of the American numbering plan: https://en.wikipedia.org/wiki/List_of_North_American_Numberi...


But that isn't because +12 is a country code: it is because, as your link even shows, some of those are codes are international. I did not claim anything about the country, only the parsing process and how using +12 as an example is just confusing the whole matter as the reader is probably familiar with +1 and +12 can't exist.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: