I have an idea for iconv that you can please forward upstream one day, (as I recall upstream is not very friendly so I dare not forward it myself.) iconv [--replace-illegal-characters-with '<string>'] That way one could still get output, like -c, and at the same time be aware of what was bad. As to details, e.g., does it replace each char one by one, or a whole string of them at once, I leave up to you. Anyways, abcdef@@@@@abcdef looks good to me for output from "iconv -c --replace-illegal-characters-with @" .