Answer the question
In order to leave comments, you need to log in
How to get rid of UnicodeEncodeError?
I import data from a CSV file into Mysql 5.7. UTF-8 file. Base UTF-8. script python 3.6.6 - utf-8
Django 1.11.15
on some records (approximately 25 out of 5000) import error UnicodeEncodeError: 'utf-8' codec can't encode characters in position 16-27: surrogates not allowed at the moment query execution using django orm
Which way to dig?
attempts to mystr.encode(errors='ignore') result in a message that a byte object is expected and not a string.
On the dev server, the error is not reproduced. There Mariadb 10.1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question