title: Database agnostic way to say I want a column to be UTF-8 in SqlAlchemy?
body: <p>I noticed that my MySQL database isn't set to do UTF-8 by default. The <code>latin1_swedish_ci</code> collation is selected instead.</p>
  
  <p>So naturally I encountered a user reported bug that my application didn't support special characters. I went and made sure my app handled UTF-8 right, wrote a test, and sure enough it worked fine with in-memory SQLite but not production MySQL.The solution I seem to get from the SQLAlchemy documentation is to pass a collation on my column:</p>
  
  <pre><code> column = db.Column(db.String(500, collation='utf8_general_ci'))
  </code></pre>
  
  <p>Sadly, this causes my unit tests based around SQLite to fail -- utf8_general_ci isn't a supported encoding for SQLite. Its MySQL specific.</p>
  
  <p>SQLite seems fine with UTF-8 without specifying a collation. I can and do test with MySQL, but an in memory SQLite database is a much faster and straight-forward testing option for spot tests. I really prioritize ease of testing, so getting back to testing with SQLite is a big priority for me.</p>
  
  <h3>Other things I've tried</h3>
  
  <p>I've also tried adding</p>
  
  <pre><code>charset=utf8&amp;use_unicode=1
  </code></pre>
  
  <p>to my connect string. I've also used <code>db.Unicode</code> instead of <code>db.String</code>. It seemed to make no difference.</p>
  
  <h3>Question</h3>
  
  <p>Is there a straight-forward and database agnostic way through SQLAlchemy to indicate a column should be encoded with UTF-8?</p>