On 06/27/2010 05:33 AM, born in USSR wrote:
> I have string: '\u041f\u0440\u0438\u0432\u0435\u0442!' and i need to
> convert it to string such as '扭把我志快找!'.
> I can convert string to '041f 0440 0438 0432 0435 0442', then convert to
> decimal and at the end convert each code to character with function:
>
>    
>> str.scan(/[0-9]+/).each {|x| result_str<<  x.to_i}
>>      
> but i don't think that it is the most rational way.
>    

irb(main):001:0> RUBY_VERSION
=> "1.9.1"
irb(main):002:0> puts '\u041f\u0440\u0438\u0432\u0435\u0442!'
\u041f\u0440\u0438\u0432\u0435\u0442!
=> nil
irb(main):003:0> puts "\u041f\u0440\u0438\u0432\u0435\u0442!"
妤把我志快找!
=> nil

Note the difference in single quotes versus double quotes.

-Justin