Articles tagged with: encoding

Ruby 1.9 and file encodings

Posted by Andreas on Friday, July 24, 2009 at 12:17 (CEST)

Just out of curiosity, I took two of my recent Rails applications today and tried them with Ruby 1.9. It was surprisingly easy to make all tests pass without any warnings or errors. Rails 2.3 already has quite good support for Ruby 1.9. The main gotcha however was about file encodings. If you have source files which contain non-ASCII characters, Ruby 1.9 now needs to know which encoding the file was saved with. If you don’t specify the encoding for a file with non-ASCII characters, you’ll get an invalid multibyte char (US-ASCII) error message.

Read more »
• Tags: , , ,
CommentsPermalink