From: Robert Klemme Date: 2010-11-25T18:45:07+09:00 Subject: Re: Ruby 1.8 vs 1.9 On Wed, Nov 24, 2010 at 5:09 PM, Brian Candler wrote: > Phillip Gawlowski wrote in post #963602: >> Convert your strings to UTF-8 at all times, and you are done. This may be true for the western world but I believe I remember one of our Japanese friends state that Unicode does not cover all Asian character sets completely; it could have been a remark about Java's implementation of Unicode though, I am not 100% sure. > But that basically is my point. In order to make your program > comprehensible, you have to add extra incantations so that strings are > tagged as UTF-8 everywhere (e.g. when opening files). > > However this in turn adds *nothing* to your program or its logic, apart > from preventing Ruby from raising exceptions. Checking input and ensuring that data reaches the program in proper ways is generally good practice for robust software. IMHO dealing explicitly with encodings falls into the same area as checking whether an integer entered by a user is strictly positive or a string is not empty. And I don't think you have to do it for one off scripts or when working in your local environment only. So there is no effort involved. Brian, it seems you want to avoid the complex matter of i18n - by ignoring it. But if you work in a situation where multiple encodings are mixed you will be forced to deal with it - sooner or later. With 1.9 you get proper feedback while 1.8 may simply stop working at some point - and you may not even notice it quickly enough to avoid damage. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/