Corrected handling of UTF-8 encoding by iconv.

Thanks to OuNao for finding and fixing the bug
https://github.com/OuNao