Avoid some charset lookups

Background info at e.g. http://bugs.mysql.com/bug.php?id=61105