Home > Back-end >  MySQL Error: Unhandled exception: 'ascii' codec can't decode byte 0xef in position 0:
MySQL Error: Unhandled exception: 'ascii' codec can't decode byte 0xef in position 0:

Time:04-25

I downloaded a Google Sheets workbook as a CSV file and tried to import it as a table in my MySQL Workbench, but I keep getting this error...

Unhandled exception: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)

I've tried to export it/save it differently multiple times, but nothing has worked.

Any help with this would be greatly appreciated! Thank you!

CodePudding user response:

The 0xEF value is the first byte of the byte order mark in the UTF-8 encoded CSV file you exported.

Specify UTF-8 text encoding instead of ASCII encoding when you import the file.

If you cannot specify which text encoding to use, convert the file to ASCII before importing. You can do that with most modern text editors, e.g., Notepad . See its documentation regarding New document and Encoding menu.

  • Related