Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert from JSON containing strings with non-ascii characters are escaped as unicode for lists, tuples, dicts. #257

Closed
dylan-wu opened this issue Apr 26, 2021 · 0 comments

Comments

@dylan-wu
Copy link
Contributor

JSON Test File (test.json):

[
    {
        "id": 123,
        "text": "FR Théâtre"
    },
    {
        "id": 223,
        "text": [
            "FR Théâtre"
        ]
    }
]

Command to import:

sqlite-utils insert test.db text test.json --pk=id

Resulting table view from datasette:

image

Original, db.py line 2225:

        return json.dumps(value, default=repr)

Fix, db.py line 2225:

        return json.dumps(value, default=repr, ensure_ascii=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants