Skip to content

Commit 409e423

Browse files
shnizzedynx10
andauthored
👔 Decode as ASCII instead of UTF-8
Co-authored-by: Florian Rupprecht <[email protected]>
1 parent 6412805 commit 409e423

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

CPAC/utils/bids_utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,8 @@ def bids_retrieve_params(bids_config_dict, f_dict, dbg=False):
324324

325325
for k, v in params.items():
326326
if isinstance(v, str):
327-
# Force all strings to be ASCII-compatible UTF-8
328-
params[k] = v.encode("ascii", errors="ignore").decode(
329-
"utf-8", errors="ignore"
330-
)
327+
# Force all strings to be ASCII-compatible UTF-8 (by removing all non-ASCII characters)
328+
params[k] = v.encode("ascii", errors="ignore").decode("ascii")
331329

332330
return params
333331

0 commit comments

Comments
 (0)