Regis d'Aubarede wrote in post #1061277:
> 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

Thank you very much, works like a charm. I've replaced the actual 
filename with a variable, so I can use ARGV.

kind regards,
seba

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