Guard against Encoding::UndefinedConversionError