From: Pavel Drobushevich
Date: 2008-08-19T00:23:17+09:00
Subject: Re: Ruby 1.8.* convert string to utf-8
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
--
Posted via http://www.ruby-forum.com/.