jazzband / geojson

Python bindings and utilities for GeoJSON
https://pypi.python.org/pypi/geojson/
BSD 3-Clause "New" or "Revised" License
898 stars 120 forks source link

UTF-8 \u escaping #163

Closed Creatium closed 2 years ago

Creatium commented 3 years ago

While trying to create Features with properties that have UTF-8 characters, they get encoded in to \u strings.

Way to replicate:

Is this an issue or am I missing something?

sackh commented 2 years ago

I am also getting the same issue. Example:

from geojson import Feature, Point

ft = Feature(geometry=Point((17, 73)), properties={"title": 'Invalidenstraße 116, 10115 Berlin, Germany'})
print(ft)

output:

{"geometry": {"coordinates": [17, 73], "type": "Point"}, "properties": {"title": "Invalidenstra\u00dfe 116, 10115 Berlin, Germany"}, "type": "Feature"}
rayrrr commented 2 years ago

@Creatium and @sackh a fix has been merged to master, please give it a try and confirm if possible, thanks.

sackh commented 2 years ago

@rayrrr Thanks for the quick fix, this works!