From: Michael Neumann Date: 2007-08-25T20:20:05+09:00 Subject: Re: String#length not working properly in Ruby 1.9 On Sat, 25 Aug 2007 10:54:20 +0200, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: String#length not working properly in Ruby 1.9" > on Sat, 25 Aug 2007 17:22:32 +0900, "Vincent Isambart" > writes: > > |String#size does work fine. The problem comes from the fact that the > |VM has a length instruction that has its own implementation of the > |String length. A quick fix was to remove it as does the patch below. > |An other way to fix would be to reimplement it correctly using the > |encoding aware methods. > > Thank you for the report and fix. I guess we have much left before > the complete implementation. Feel free for suggestions, proposals and > bug fixes. Hi Matz, Do I have to put a header like # -*- coding: utf-8 -*- into all my source files, or is there a command line option? 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? Regards, Michael