Ruby 1.9 - Invalid multibyte character (utf-8)
问题 I have a ruby file with only these two lines: # encoding: utf-8 puts "—" When I run it with ruby test_enc.rb it fails with: test_enc.rb:2: invalid multibyte char (UTF-8) test_enc.rb:2: unterminated string meets end of file I don't know how to properly specify the character code of — (emdash), but vim tells me it is 151, Hex 97, Octal 227 . It fails the same way with other characters like ã as well, so I doubt it is related specifically to that character. I am running on Windows XP and the