I was running a little bash script on some text files:
find . -name "*.dat" -exec iconv --from-code='UTF-8' --to-code='ASCII//TRANSLIT' {} --output={} \;
My machine is a Ubuntu 14.04 LTS.
After a while, I found that like half of the data in the files disappeared; simply cut off in the middle of a line/word. It is the mysterious signal 7
or core dump (as I heard). The problem is somehow, when the files are too large. Some of my file have >60kB but iconv
made them around 30kB.
What can I do about this? Is this a bug? Is there a workaround? Is there any other convenient way to transliterate diacritics?
iconv
truncates the file in preparation for writing the first block, any reads after that may be zero length. – Mark Plotnick Dec 26 '14 at 15:05strace
on it. It looks likeiconv
starts to write to the output file when it has amassed 32768 bytes. – Mark Plotnick Dec 26 '14 at 15:30iconv
individually on a file larger than 32 K (and overwrite the original file), I'll got the "Bus error" message, with an exit code = 135. – Guillaume Husta Feb 04 '22 at 10:58