UTF-8 required for Input queries in all Geocoding requests

732 views
Skip to first unread message

Dann (Google Employee)

unread,
Nov 18, 2009, 3:43:38 PM11/18/09
to Google Maps API Notify
Please note, we now require all input queries in any Geocoding request
URL to be UTF-8m, which must also be properly URL-encoded. If we
receive a Geocoding request which doesn't comply, we'll soon be
returning a G_GEO_BAD_REQUEST (400) status code in the response. We
hope this will help to debug invalid requests and track down its
cause.

The Geocoding Requests section was updated to specify UTF-8 as a
requirement for the "q" parameter:
http://code.google.com/apis/maps/documentation/geocoding/index.html#GeocodingRequests

Examples:
Static map centered on Beijing, using Chinese characters 北京, should
look like this:
http://maps.google.com/maps/api/staticmap?size=300x300&center=%E5%8C%97%E4%BA%AC&sensor=false&key=

The equivalent geocoding request for the same location would be:
http://maps.google.com/maps/geo?q=%E5%8C%97%E4%BA%AC&output=json&sensor=false&key=

The encoded value, %E5%8C%97%E4%BA%AC, was achieved by encoding the
query (北京) in UTF-8 and then URL-escaping the UTF-8 bytes.
Reply all
Reply to author
Forward
0 new messages