Added catch for Encoding::UndefinedConversionError