# Error reading \*.cnt eeg file

**URL:** <https://mne.discourse.group/t/error-reading-cnt-eeg-file/2796>\
**Category:** Support & Discussions\
**Tags:** data-import\
**Created:** [March 5, 2021, 2:57pm UTC](https://mne.discourse.group/t/error-reading-cnt-eeg-file/2796 "2021-03-05T14:57:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kingjr](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/kingjr/32/264_2.png) [@kingjr](https://mne.discourse.group/u/kingjr)\
**Post date:** [March 5, 2021, 2:57pm UTC](https://mne.discourse.group/t/error-reading-cnt-eeg-file/2796/1 "2021-03-05T14:57:28Z")

</div>

I’m trying to read a cnt EEG file with mne.io.read\_raw\_cnt and get “UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0x93 in position 6: ordinal not in range(128)”,

When debugging, it looks like this

```python
~/opt/anaconda3/lib/python3.7/site-packages/mne/io/utils.py in read_str(fid, count)
    242 b'\x00' in data else count]])
    243 
--> 244 return str(bytestr.decode('ascii')) # Return native str type for Py2/3

```

```python
ipdb> bytestr
b'QXyK\x08o\x93v\xa6E'

```

any idea what to do?

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [March 5, 2021, 3:25pm UTC](https://mne.discourse.group/t/error-reading-cnt-eeg-file/2796/2 "2021-03-05T15:25:17Z")

</div>

are you using current master?

can you share the file?

are you sure it’s the correct cnt format? there are 2

Neuroscan CNT data format (.cnt) and ASA CNT formats.

> 

both end .cnt

Alex

---

<div class="post-metadata">

**Author:** ![leilaelam](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/leilaelam/32/1429_2.png) [@leilaelam](https://mne.discourse.group/u/leilaelam)\
**Post date:** [May 10, 2022, 8:08am UTC](https://mne.discourse.group/t/error-reading-cnt-eeg-file/2796/3 "2022-05-10T08:08:55Z")

</div>

Hi  
I have the exact same problem when trying to read an ASA cnt EEG file with mne.io.read\_raw\_cnt.  
@kingjr did you fix it ?

---

<div class="post-metadata">

**Author:** ![mahditaghaddosi](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mahditaghaddosi](https://mne.discourse.group/u/mahditaghaddosi)\
**Post date:** [April 25, 2023, 4:35pm UTC](https://mne.discourse.group/t/error-reading-cnt-eeg-file/2796/4 "2023-04-25T16:35:59Z")

</div>

Hello.  
This is my problem too. I tried a lot to import some EEG data in .cnt format, But It was not successful. I always got the error below:

```python
**return str(bytestr.decode('ascii')) # Return native str type for Py2/3**

**UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 1: ordinal not in range(128)**

```

It would be grateful if you or MNE team can help me in this manner.

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [August 9, 2023, 6:04pm UTC](https://mne.discourse.group/t/error-reading-cnt-eeg-file/2796/5 "2023-08-09T18:04:47Z")

</div>

Sorry for the belated reply. @leilaelam and @mahditaghaddosi can you confirm if your `.cnt` files are from **Neuroscan** device or **ANTNeuro** device? Both manufacturers use a `.cnt` file extension, but the files are different formats.

If you’re using ANTNeuro device: we have an open issue discussing support for ANTNeuro files: [ENH: import ANT Neuro .CNT files (some code available) · Issue #3609 · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/issues/3609) On that thread, [this comment](https://github.com/mne-tools/mne-python/issues/3609#issuecomment-1272557341) nicely summarizes the currently available workarounds.

If you’re using Neuroscan device: we need a file that causes the error in order to be able to reproduce locally and debug. Can you provide such a file?

Cross-ref to recent, similar post: [error mne.io.read\_raw\_cnt()](https://mne.discourse.group/t/error-mne-io-read-raw-cnt/7350)
