My previous question is answered but there's a few more things I don't understand.
I have a yaml file which contains a field with a utf-8 character:
:name: O\xE2\x80\x99Reilly
When I load the yaml in irb:
>puts name.encoding => UTF-8
>name => "O\xE2\x80\x99Reilly"
>puts name => O’Reilly
When I load the yaml in Rails:
>puts name.encoding => UTF-8
>puts name => Oâ[80][99]Reilly
>puts name.force_encoding('utf-8') => Oâ[80][99]Reilly
>puts Iconv('iso-8859-1', '', name) => O’Reilly
Q3: Why does rails print it's initial utf-8 string as if it's iso-8859-1, and the string converted to iso-8859-1 as if it's utf-8?