tybug / ossapi

The definitive python wrapper for the osu! api.
https://tybug.github.io/ossapi/
GNU Affero General Public License v3.0
80 stars 17 forks source link

Fix non-ascii characters when using serialize_model() #39

Closed aticie closed 3 years ago

aticie commented 3 years ago

Fixes responses for requests to beatmaps with Unicode titles:

Formerly

bmap = api.beatmap(2293914)
print(serialize_model(bmap))

would return:

..., "beatmapset": {"artist": "Sally", "artist_unicode": "\u30b5\u30ea\u30fc", ...

With this change it returns:

..., "beatmapset": {"artist": "Sally", "artist_unicode": "サリー", ...

unless ensure_ascii=True is explicitly provided.