In pandas read_json, UTF-8 accented or diatric characters are converted to angle brackets of corresponding hex values. How can this be avoided or fixed to render actual UTF-8 character value?
Consider the following example that pulls from an S3 bucket of all current R GitHub CRAN packages. Notice output of accented characters are represented by angle bracketed hex values:
import pandas as pd
# S3 (REQUIRES s3fs)
json_df = pd.read_json("s3://public-r-data/ghcran.json")
# URL (NO REQUIREMENT)
json_df = pd.read_json("http://public-r-data.s3-website-us-east-1.amazonaws.com/ghcran.json")
json_df.loc[884, "Title"]
# Misc Functions of Eduard Sz<c3><b6>cs
json_df.loc[213, "Author"]
# Kirill M<c3><bc>ller [aut, cre]
json_df.loc[336, "Maintainer"]
# H<c3><a9>l<c3><a8>ne Morlon <morlon@biologie.ens.fr>
To avoid a mapping dictionary replace solution for these hex values, is there a compact solution to avoid or fix such embedded hex values to actual UTF-8 characters? Specifically, how can above results be converted to the following:
# Misc Functions of Eduard Szöcs
# Kirill Müller [aut, cre]
# Hélène Morlon <morlon@biologie.ens.fr>