Call iconv from Ruby through system()
Posted
by Sebastian
on Stack Overflow
See other posts from Stack Overflow
or by Sebastian
Published on 2010-04-30T08:16:45Z
Indexed on
2010/04/30
9:27 UTC
Read the original article
Hit count: 338
I have a problem with iconv tool. I try to call it from rake file in that way:
Dir.glob("*.txt") do |file|
system("iconv -f UTF-8 -t 'ASCII//TRANSLIT' #{ file } >> ascii_#{ file }")
end
But one file is converted partly (size of partialy converted: 10059092 bytes, before convertion: 10081854). Comparing this two files prove that not all content was writen to ASCII. When I call this command explicit from shell it works perfectly. Other smaller files are converted without problems. Is there any limitations on iconv or Ruby's system()?
© Stack Overflow or respective owner