From: Benoit Daloze Date: 2010-06-28T22:24:44+09:00 Subject: Re: Convert \uXXXX to character On 28 June 2010 07:39, Markus Schirp wrote: > IMHO better than eval ;) str = '\u041f\u0440\u0438\u0432\u0435\u0442!' p str.gsub(/\\u(\h{4})/) { $1.to_i(16).chr('UTF-8') } What do you say of this? Well, I was searching something in the line of String#unpack, like p str.gsub(/\\u(\h{4})/) { [$1.to_i(16)].pack('U') } but as we are scanning one by one, it is not interesting and need an extra array like in JSON (but it is 1.8 compatible). B.D.