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

Doublebyte content is unicode-escaped in JSON output #625

Open
oli opened this issue Apr 3, 2024 · 0 comments
Open

Doublebyte content is unicode-escaped in JSON output #625

oli opened this issue Apr 3, 2024 · 0 comments

Comments

@oli
Copy link

oli commented Apr 3, 2024

test.json

[
    {
        "id": 123,
        "text": "Japanese 日本語"
    },
    {
        "id": 223,
        "text": [
            "Japanese 日本語"
        ]
    }
]

Import

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

Query using sqlite-utils

sqlite-utils test.db "select * from text"
[{"id": 123, "text": "Japanese \u65e5\u672c\u8a9e"},
 {"id": 223, "text": "[\"Japanese \u65e5\u672c\u8a9e\"]"}]

sqlite-utils test.db "select * from text" --csv
id,text
123,Japanese 日本語
223,"[""Japanese 日本語""]"

I assume this is something to do with “ensure ascii” for JSON, but is there any way I can get non-escaped content strings in sqlite-utils JSON output? Thanks!

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

1 participant