• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: International phone code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: International phone code


  • Subject: Re: International phone code
  • From: PGM <email@hidden>
  • Date: Wed, 17 Jan 2007 14:25:10 -0500


On 17-Jan-07, at 12:35 PM, Piers Uso Walter wrote:


On 17.01.2007, at 18:23, Claudio Procida wrote:

I premit this is NOT related to the iPhone in any way!

Is there any way to retrieve the user's own international country code (001, 0039, 0044 etc.)??

I'm developing a plugin linked to the address book and I'd like to extract such information in a convenient way.

Otherwise I guess I'll have to manage a GIANT lookup table and search for the user's own country name.

If you can make these assumptions:
- user has an address book entry for her personal contact data, including her phone number
- phone numbers are entered in 'international' format (i.e. +1..., +39... etc.).
it should be as easy as retrieving 'my address card', then checking the number.


Otherwise, the table sounds good, and it'll not be as gigantic as you may think (only a couple of hundred entries).
Be aware, though, that these numbers tend to change over time (e.g. when countries like Czechoslovakia or Yugoslavia split up, or when countries like Monaco suddenly get their own country code (after previously having shared country codes like Monaco did with France). So you may have to update the table once or twice per decade ;-)



One problem with the lookup-table may be that the spelling of the country has to be correct, which may be quite a strict assumption for countries like Czechoslovakia, so you may have to allow for some ambiguity there. Furthermore, some countries go by more than one name (US, USA, United States of America). Localisation also complicates things a bit, as you have to look up the country names in all languages that are available to your app. Even if you have no localisation, some users may write the names in their own language. I use an English OS, but write my addressbook entries in Dutch.


Cheers, Patrick
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >International phone code (From: Claudio Procida <email@hidden>)
 >Re: International phone code (From: Piers Uso Walter <email@hidden>)

  • Prev by Date: Core Data life cycle, how to do setup that works with undo in an NSManagedObject?
  • Next by Date: NSOutlineView space next to disclosure triangle
  • Previous by thread: Re: International phone code
  • Next by thread: Re: International phone code
  • Index(es):
    • Date
    • Thread