Open franklan opened 10 years ago
将
str.encode('UTF-8') if str.encoding != 'UTF-8'
改为
str = str.force_encoding('GBK') str = str.encode('UTF-8')
Encoding::UndefinedConversionError: "\xE5" from ASCII-8BIT to UTF-8