From: Brian Candler Date: 2009-02-10T22:54:21+09:00 Subject: Re: YAML + ASCII Encoded Unicode Something like this should do: data = File.read("source.txt") data.gsub!(/\\x([0-9a-f]{2})/i) { $1.hex.chr } File.write("output.txt","w") { |f| f.write(data) } (You can check with 'hexdump -C output.txt' that you get a single byte for each \xHH code) Then just open the file with any text editor which supports UTF-8. However, this file may be invalid YAML - so it may only be useful for reading and copy/pasting from. In that case, you might be better just reading in the YAML into Ruby, and then outputting the parts you're interested in. require 'yaml' src = "---\nfoo: \"Donn\\xC3\\xA9es de votre location\"" data = YAML.load(src) puts data["foo"] -- Posted via http://www.ruby-forum.com/.