0x91 is the Windows-1251 representation of Unicode's \u2018
(AKA ‘
):
>> "\x91".force_encoding('windows-1251').encode('utf-8')
=> "‘"
Windows-1251 and Latin-1 (AKA ISO 8859-1) are not the same, try using windows-1251
as the encoding:
IO.read('file', :encoding => 'windows-1251')
That will give you a string that knows it is Windows-1251. If you want UTF-8, then perhaps you want to specifying the :internal_encoding
and :external_encoding
:
IO.read('file', :external_encoding => 'windows-1251', :internal_encoding => 'utf-8')