Sebastjan H. wrote in post #1061276:

> File.open(file, "Unicode") {|fin|
>   File.open(file, "wb:UTF-8") { |fout|
>     fout.write(fin.read())
>   }
> }

> regards,
> seba

data=nil
open("data.txt", "rb:UTF-16LE") {|fin| data=fin.read() }
open("data.txt", "wb:UTF-8")  { |fout| fout.write(data) } if data

-- 
Posted via http://www.ruby-forum.com/.