How do I get SQLAlchemy to correctly insert a unicode ellipsis into a mySQL table?

前端 未结 2 1373
天命终不由人
天命终不由人 2020-12-24 09:31

I am trying to parse an RSS feed with feedparser and insert it into a mySQL table using SQLAlchemy. I was actually able to get this running just fine but today the feed had

2条回答
  •  失恋的感觉
    2020-12-24 09:59

    Adding charset=utf8 in the connection string definitely helps, but I encountered situations in Python 2.7 when adding convert_unicode=True to create_engine was also necessary. SQLAlchemy documentation says it's only to boost performance, but in my case it actually solved the problem of the wrong encoder being used.

提交回复
热议问题