From: Yukihiro Matsumoto Date: 2007-08-25T20:36:16+09:00 Subject: Re: String#length not working properly in Ruby 1.9 Hi, In message "Re: String#length not working properly in Ruby 1.9" on Sat, 25 Aug 2007 20:20:05 +0900, "Michael Neumann" writes: |Do I have to put a header like | | # -*- coding: utf-8 -*- | |into all my source files, or is there a command line option? You can specify -Ku option for UTF-8 scripts, but I recommend coding pragma, especially for library files. |If I read from a file a string, it is automatically in US-ASCII encoding. |How do I change the encoding, e.g. if I know that the file is in UTF-8? Although it's not done yet, you can specify reading encoding for files, e.g. open(path, "r:utf-8") {|f| ... } matz.