Once a day my server needs to process a huge csv text file. It has to be converted from UTF8 to ISO8859-1 using iconv. Sometimes there has been special characters like ń in the file and this is considered an illegal input for ISO8859-1. I have decided to use //translit like this:

$ cat test
This ń is bad

$ file test
test: UTF-8 Unicode text

$ iconv -f UTF-8 -t ISO8859-1 test
This iconv: illegal input sequence at position 5

$ iconv -f UTF-8 -t ISO8859-1//TRANSLIT test
This n is bad

This solution is all fine, but i would like to monitor the solution for some days. How do I know when and which characters that has been replaced? I've tried the --verbose option but that only gives me this output:

$ /usr/bin/iconv -f UTF-8 -t ISO8859-1//TRANSLIT test --verbose
This n is bad

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.