开发者

wrong ISO returned from CTCarrier on iPhone for certain countries

开发者 https://www.devze.com 2023-03-18 05:31 出处:网络
This is not a question but rather a note for other developers who might be using CTCarrier. I have been developing an app which requires reading the iso of the SIM card to determine the country the

This is not a question but rather a note for other developers who might be using CTCarrier.

I have been developing an app which requires reading the iso of the SIM card to determine the country the app is being used in (at least the 开发者_JAVA百科SIM country). The doc mentions the following about the isoCountryCode property:

This property uses the ISO 3166-1 country code representation.

From my tests and deployment however it appears that the returned iso is not the standard ISO 3166-1 for several countries (not sure if this is Apple's mistake of the carrier who stored the info in the SIM)! So i had to do a translational phase to resolve the incorrect ISO's. The following is the list i have got to so far (will keep updating it once i get new incorrect iso's):

Country:             ISO I get        Expected ISO
----------           ----------       -------------
UK                      uk                 gb     
Japan                   ja                 jp

Cheers AF


UK was reserved by the the United Kingdom (and is an an appendix to the standard) so that's a grey area ;)

JA should be Jamacia - why do you expect this to be Japan?

Info from here : http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

0

精彩评论

暂无评论...
验证码 换一张
取 消