Force encodings so that exceptions aren't thrown with bad data