From: Alexey Petrushin Date: 2011-04-09T06:39:27+09:00 Subject: to_yaml in utf-8 encoding Hello, can you please help me with this tricky problem: Is there a way to force utf-8 encoding in to_yaml, ruby 1.9? require 'yaml' p "alex".to_yaml # "--- alex\n" p "Алекс".to_yaml # "--- \"\\xD0\\x90\\xD0\\xBB\\xD0\\xB5\\xD0\\xBA\\xD1\\x81\"\n" P.S. Maybe I missing something or don't understand. I can't get it, why we should bother about encoding in todays? Why there's such a strange situation with encoding in ruby 1.9? It's impossible to set utf-8 as default (only via command-line command)? All thouse tricky defaults and conversions ... According to TIOBE the Java user base, installation base and community about 30 times more than Ruby. And it's the universal language, You can apply it generally almost to anything, and the only encoding that exist there - it's UTF. In 99.9% of cases You use UTF. So, why the Ruby adds such a complexity? What's the point, why you may want ever to go with ANSI-8BIT? -- Posted via http://www.ruby-forum.com/.