试试:http ://maps.googleapis.com/maps/api/geocode/json?address =Őrbottyán,Hungary&sensor=true
在 iPhone 4 和模拟器上,
-(void)requestFailed:(ASIHTTPRequest *)request {
NSLog(@"geocode fail code: %d",[request responseStatusCode]);
NSLog(@"geocoding failed: %@",[request responseString]);
}
2011-06-01 11:36:27.343 app[1174:307] geocode fail code: 0
2011-06-01 11:36:27.345 app[1174:307] geocoding failed: (null)
在浏览器中,我得到:
"results" : [
{
"address_components" : [
{
"long_name" : "Őrbottyán",
"short_name" : "Őrbottyán",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Pest",
"short_name" : "Pest",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "Hungary",
"short_name" : "HU",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Őrbottyán, Hungary",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 47.7138950,
"lng" : 19.34353090
},
"southwest" : {
"lat" : 47.63339999999999,
"lng" : 19.2051070
}
},
"location" : {
"lat" : 47.6846190,
"lng" : 19.2883260
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 47.7138950,
"lng" : 19.34353090
},
"southwest" : {
"lat" : 47.63339999999999,
"lng" : 19.2051070
}
}
},
"types" : [ "locality", "political" ]
}
],“状态”:“确定”}
其他带有标准英文字符的请求确实可以在设备上正常工作并返回。