Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7815081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:24:05+00:00 2026-06-02T05:24:05+00:00

I am using googlemaps Python package to do reverse geocoding. Observe: PS Z:\dev\poc\SDR> python

  • 0

I am using googlemaps Python package to do reverse geocoding. Observe:

PS Z:\dev\poc\SDR> python
Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from googlemaps import GoogleMaps
>>> gmaps = GoogleMaps("*** my google API key ***")
>>> d=gmaps.reverse_geocode(51.75,19.46667)
>>> d
{u'Status': {u'code': 200, u'request': u'geocode'}, u'Placemark': [{u'Point': {u'coordinates': [19.466876, 51.7501456, 0]}, u'ExtendedData': {u'LatLonBox': {u'west': 19.465527, u'east': 19.468225, u'n
orth': 51.7514946, u'south': 51.7487966}}, u'AddressDetails': {u'Country': {u'CountryName': u'Polska', u'AdministrativeArea': {u'SubAdministrativeArea': {u'SubAdministrativeAreaName': u'\u0141\xf3d\u0
17a', u'Locality': {u'Thoroughfare': {u'ThoroughfareName': u'ksi\u0119dza Biskupa Wincentego Tymienieckiego 16'}, u'LocalityName': u'\u0141\xf3d\u017a'}}, u'AdministrativeAreaName': u'\u0142\xf3dzkie'
}, u'CountryNameCode': u'PL'}, u'Accuracy': 8}, u'id': u'p1', u'address': u'ksi\u0119dza Biskupa Wincentego Tymienieckiego 16, 90-001 \u0141\xf3d\u017a, Poland'}], u'name': u'51.750000,19.466670'}
>>> import pprint
>>> pp = pprint.PrettyPrinter(indent = 2)
>>> pp.pprint(d)
{ u'Placemark': [ { u'AddressDetails': { u'Accuracy': 8,
                                         u'Country': { u'AdministrativeArea': { u'AdministrativeAreaName': u'\u0142\xf3dzkie',
                                                                                u'SubAdministrativeArea': { u'Locality': { u'LocalityName': u'\u0141\xf3d\u017a',
                                                                                                                           u'Thoroughfare': { u'ThoroughfareName': u'ksi\u0119dza Biskupa Wincentego Tym
ienieckiego 16'}},
                                                                                                            u'SubAdministrativeAreaName': u'\u0141\xf3d\u017a'}},
                                                       u'CountryName': u'Polska',
                                                       u'CountryNameCode': u'PL'}},
                    u'ExtendedData': { u'LatLonBox': { u'east': 19.468225,
                                                       u'north': 51.7514946,
                                                       u'south': 51.7487966,
                                                       u'west': 19.465527}},
                    u'Point': { u'coordinates': [19.466876, 51.7501456, 0]},
                    u'address': u'ksi\u0119dza Biskupa Wincentego Tymienieckiego 16, 90-001 \u0141\xf3d\u017a, Poland',
                    u'id': u'p1'}],
  u'Status': { u'code': 200, u'request': u'geocode'},
  u'name': u'51.750000,19.466670'}

Now, I want to save the d dictionary to a file, but I do not want to see u'\u0141\xf3d\u017a' as the locality name. I want to see Łódź. Indeed:

  • \u0141 – http://www.fileformat.info/info/unicode/char/0141/index.htm
  • \xf3 = \u00f3 – http://www.fileformat.info/info/unicode/char/00f3/index.htm
  • \u017a – http://www.fileformat.info/info/unicode/char/017a/index.htm

So, I have tried this:

with codecs.open("aa.txt", "w", "utf-8") as f:
  f.write(unicode(d))

and this:

with codecs.open("aa.txt", "w", "utf-8") as f:
  f.write(unicode(str(d), "utf-8"))

and this:

with open("aa.txt", "w") as f:
  f.write(unicode(d))

And of course, nothing works. All the trials yield \u0141\xf3d\u017a. How can I save it correctly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:24:06+00:00Added an answer on June 2, 2026 at 5:24 am

    Pass ensure_ascii=False to json.dump*() and use codecs.open().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to screenscrape the first result of a Google search using Python and
Ive got a problem, Im using jquery for my googlemaps thingy Im doin and
I'm trying to use the GoogleMaps JavaScript library from inside of SpiderMonkey using the
i am using GoogleMaps and i have 2 or more markers and they are
For some reasons I'm using an Iframe to display googlemaps, when I want to
I want to test the Google Maps Static API with Django 1.3 (using Python
I was wondering if its possible to geocode something using googlemaps api synchronously so
I'm using PyKml module in order to form kml inside my Python script. I
I am trying to translate a string using google translate API. #!/usr/bin/env python #
I'm trying to interact with a google map using python. I've built an application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.