From: "Bartosz Dziewoński" Date: 2012-04-17T05:39:17+09:00 Subject: Re: Upgrading to Ruby 1.9 - Should I? Is it painful? W dniu 16 kwietnia 2012 22:05 użytkownik Brian Candler napisał: > IME it's pretty painful, in particular if you have programs which use > Strings, and you want to understand how they work in ruby 1.9. As much as I admire Brian's work on documenting 1.9's String behavior, you will be fine on 1.9 if you stick to two rules: 1. Always use UTF-8 internally. Encode your source files as UTF-8 and add #coding: magic comments to every file. Make sure any data files are in UTF-8 too. This will help you and everyone reading your code in the future, not just Ruby. 2. Always immediately convert any incoming data to UTF-8. Sensible frameworks should already do it for you, but mind it if rolling your own. Use code like File.open('asd.txt', 'r:utf-8') if necessary. (E.g. if it doesn't work without the utf-8 part.) (3.) Optionally, if possible, switch to an operating system that is UTF-sane in the console. (Windows, I'm looking at you...) (Although my primary environment is Windows and I have no troubles with it, save for occasionally having to encode stuff as CP852 for printing to console.) -- Matma Rex