Encoding::UndefinedConversionError handled by replacing undefined character with empty string.