Why Geocoder from Google Maps is returning japanese character?

前端 未结 2 1642
轻奢々
轻奢々 2021-01-14 11:22

I have a method with body like this:

Address address = new Geocoder(context).getFromLocation(latitude, longitude, 5).get(0);
return address.getThoroughfare()         


        
相关标签:
2条回答
  • 2021-01-14 11:28

    The constructor of the Geocoder class takes a Locale Object as parameter. With this you can have the output in any supported language. If you don't set a explicit local, as in your snippet, Locale.getDefault() will be used by default.

    Address address = new Geocoder(context, Locale.ENGLISH)
            .getFromLocation(latitude, longitude, 5).get(0);
    
    0 讨论(0)
  • 2021-01-14 11:35

    It returns that way because that's how it's labeled in Google Maps. The Japanese characters you see(アウファヴィーレ) are the representation for Alphaville, a development company in that area.

    Why someone labeled it in Japanese, I don't know. There's not much you can do about it, though. Other locations nearby aren't labeled this way.

    0 讨论(0)
提交回复
热议问题