RhetTbull / locationator

A simple macOS menubar app that provides access to the macOS Location Services reverse geocoding API via a local web server as well as a command line tool.
MIT License
17 stars 0 forks source link

Unicode names are not handled correctly #6

Closed RhetTbull closed 8 months ago

RhetTbull commented 8 months ago

For example:

{"location": [33.95, 118.2], "name": "\u9752\u6d77\u6e56\u897f\u8def", "thoroughfare": 
"\u9752\u6d77\u6e56\u897f\u8def", "subThoroughfare": "", "locality": "Suqian", "subLocality": "", "administrativeArea": 
"Jiangsu", "subAdministrativeArea": "", "postalCode": "", "ISOcountryCode": "CN", "country": "China", "postalAddress": 
{"street": "\u9752\u6d77\u6e56\u897f\u8def", "city": "Suqian", "state": "Jiangsu", "country": "China", "postalCode": "", 
"ISOCountryCode": "CN", "subAdministrativeArea": "", "subLocality": ""}, "inlandWater": "", "ocean": "", "areasOfInterest": 
[], "timeZoneName": "Asia/Shanghai", "timeZoneAbbreviation": "GMT+8", "timeZoneSecondsFromGMT": 28800}%

The data is actually:

placemark_dict={'location': (33.95, 118.2), 'name': '青海湖西路', 'thoroughfare': '青海湖西路', 'subThoroughfare': '', 
'locality': 'Suqian', 'subLocality': '', 'administrativeArea': 'Jiangsu', 'subAdministrativeArea': '', 'postalCode': '', 
'ISOcountryCode': 'CN', 'country': 'China', 'postalAddress': {'street': '青海湖西路', 'city': 'Suqian', 'state': 'Jiangsu', 'country': 
'China', 'postalCode': '', 'ISOCountryCode': 'CN', 'subAdministrativeArea': '', 'subLocality': ''}, 'inlandWater': '', 'ocean': '', 
'areasOfInterest': [], 'timeZoneName': 'Asia/Shanghai', 'timeZoneAbbreviation': 'GMT+8', 'timeZoneSecondsFromGMT': 28800}

But the non-ASCII characters are encoded and show as unicode byte sequences, not as decoded unicode.

RhetTbull commented 8 months ago

This appears to be working correctly.