Translate UTF-8 files into ISO Latin 1 (ISO-8859-1) This is very easy as ISO-8859-1 is the first codepage of UTF-8. This warns about ignored characters which are not in the Latin1 codepage. Ignore stderr if you don't want the warnings. Note that this was only tested within the Latin1 codepage, so if you find some values outside Latin1 the UTF-8 reading code might be broken. If you want to have non-Latin1 characters in your database, perhaps better store UTF-8 in it to avoid confusion. Usage: utf8-latin1 [error-string] 2>/dev/null If [error-string] is given (first argument) this string is printed instead of the non-Latin1-characters (else the character is skipped). SECURITY WARNING: The [error-string] is a format string to printf, where the one and only printf-arg is a (signed) long which holds the UTF-8 character which is not in range of Latin1 (thus <0 or >0xff, where <0 denotes an illegal UTF-8 encoding was found, see source code). So it is definitively a bad idea to install this program SUID or give users the option to pass any first argument. Example error-string which prints the hex value of the non-latin character: ./utf8-latin "[[non-latin code %04lx]]" Example error-string which makes the program react unpredictable (perhaps even segv, buffer overrun or delete the whole universe): ./utf8-latin "%04lx %s" YOU SHOULD NEVER DO THIS!!! Example error-string which should put out a percent sign: ./utf8-latin "%%" Example error-string which should put out a percent sign and then the hex value of the non-latin character: ./utf8-latin "%%%lx" (You've got it now, hopefully)