title: Check if String is Valid MySQL UTF8?
body: <p>I have a MySQL column encoded as utf8. That utf8 is not actually the full utf8 set, but <a href="http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html" rel="nofollow">only BMP characters only up to 3 bytes in length</a>. I don't want to try to insert utf8 into MySQL only to find it does not meet MySQL's parameters for what utf8 should be. Is there a way to test in Python if something meets MySQL's parameters before attempting to insert? For obvious reasons, catching exceptions on <code>some_string.encode('utf-8')</code> is not strict enough.</p>