I posted on stack overflow a few days ago with a similar problem (which was solved), and I\'m not sure what the proper etiquette is here, but I\'m making a new post.
\u2013
is an "en dash". Perhaps some word processor is creating that? Perhaps you would be happy enough with a simple -
?
See https://docs.sqlalchemy.org/en/latest/dialects/mysql.html#mysql-unicode
Well, within an hour of posting my question, I already figured it out. Maybe I should have done a bit more research before posting.
The problem is that sqlalchemy needs to be configured to use utf-8 encoding. The solution in the above code would be to change line 3 to:
engine = create_engine('mysql://root:@localhost/testdb?charset=utf8', encoding = 'utf-8')