-
Notifications
You must be signed in to change notification settings - Fork 92
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
UTF-8 Encoding is not respected by make_dataset_description #1356
Comments
That's odd, as we do write JSON files in UTF-8 encoding (as the JSON standard requires): Lines 236 to 239 in 46f284b
Which operating system are you using? |
I'm on an Intel Mac! And using the development version of MNE-BIDS and MNE-Python v1.9:
|
Possibly unrelated but something's wrong with your installation. The version string isn't right. Be sure to fetch all tags. |
Reproducible with: import mne_bids
mne_bids.write._write_json("/tmp/foo.json", {"name": "Michał"}, overwrite=True) ❯ cat /tmp/foo.json
{
"name": "Micha\u0142"
} |
The bug is in our call to https://docs.python.org/3/library/json.html#json.dumps Calling json_output = json.dumps(dictionary, indent=4, ensure_ascii=False) fixes the issue @larsoner @sappelhoff I'm afraid we'll find this problem among different parts of the MNE codebase… |
At least in MNE-Python I think we want the default
So really the scope is a bit more limited I think: we should check for places where we actually write to a |
Yes this is exactly what I had in mind! |
Thx @hoechenberger and @larsoner ! Given that I need this to be fixed for a project, I can take a shot at it (maybe over xmas break). But no problem if someone beats me to it 🙂 |
Description of the problem
Given the wide use of
encoding=utf-8-sig
in mne-bids, I assume that the example below is a bug, andmne-bids
does want to support characters like ł (latin small letter with stroke) that appear in some people's namesSteps to reproduce
Expected results
WHAT I WOULD EXPECT: Michał is a name that includes the character ł.
Actual results
Additional information
I took a quick look at the code but haven't figured out yet what is going wrong☹️
The text was updated successfully, but these errors were encountered: