Sometimes the db returns None or empty string for encoding.  Fallback to
UTF-8 in this case