title: How can I convert a local phone number to the international format in an iPhone app?
body: <p>I am developing an iPhone app.  At one point, the user types phone numbers.  These can be in any format, international or local.  Local format would be something like <code>514-123-4567</code> (or worse, just <code>123-4567</code>), is there a way to convert local phone numbers to the international format (E.164): <code>+15141234567</code>?  This means finding out what the country is (and perhaps the region too, if possible).</p>
  
  <p>One way would be to require the user to always enter phone numbers using the international format, or to select the country she's in.  But if I can avoid that, I think it would be more user friendly.</p>
  
  <p>I would also like to avoid asking the user for the authorization to geolocate her: a lot of users refuse geolocation.</p>
  
  <p>Ideally, I would like to get the country and region of her own phone number.  Or perhaps the current carrier's country (in case the user is roaming in another country than hers).</p>
  
  <p>But what if she installed the app on an iPod or iPad without a SIM card?  Maybe I could use the locale?  Or I could try to geolocate the IP address?</p>
  
  <p>Any better ideas?</p>