to_unicode: support remedial_encodings and non-strict mode