From: Michal Suchanek Date: 2008-08-19T12:59:59+09:00 Subject: Re: Ruby 1.8.* convert string to utf-8 On 18/08/2008, Pavel Drobushevich wrote: > Dear Axel, > Thank you at the your answer. > But maybe I didn't good explain my problem, I have some problem with > English. > > > > require 'iconv' > > > > s =IO.read('kknta10.txt') > > > > ic = Iconv.iconv('utf-8', 'cp1251',s) > > f=File.new("t.txt","w") > > f.puts ic > > f.close > > > > > It's good idea, and I used it. But, I has many files with different > encoding: utf8, cp1251, ucs-2le, .... and I need convert all this files > to utf-8 by one code, I need to identify encoding of file in run time, > not to fix with const for every file, because files generate other > system. > Thanks > Have you tried enca? http://dl.cihar.com/MIRROR/enca/ The functionality of this kind software is necessarily limited but if you know you will only use documents in Russian it should give pretty good results. HTH Michal