Skip to content

Commit c124cf5

Browse files
committed
neuralynx encoding error
1 parent 72ec76a commit c124cf5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

neo/rawio/neuralynxrawio/nlxheader.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ def _to_bool(txt):
5555
("DspHighCutNumTaps", "", None),
5656
("DspHighCutFilterType", "", None),
5757
("DspDelayCompensation", "", None),
58-
("DspFilterDelay_µs", "", None),
58+
# DspFilterDelay key with flexible µ symbol matching
59+
# Different Neuralynx versions encode the µ (micro) symbol differently:
60+
# - Some files use single-byte encoding (latin-1): DspFilterDelay_µs (raw bytes: \xb5)
61+
# - Other files use UTF-8 encoding: DspFilterDelay_µs (raw bytes: \xc2\xb5)
62+
# When UTF-8 encoded µ (\xc2\xb5) is decoded with latin-1, it becomes "µ"
63+
# This regex matches both variants: "µs" and "µs" but normalizes to "DspFilterDelay_µs"
64+
(r"DspFilterDelay_[Â]?µs", "DspFilterDelay_µs", None),
5965
("DisabledSubChannels", "", None),
6066
("WaveformLength", "", int),
6167
("AlignmentPt", "", None),

0 commit comments

Comments
 (0)