More safe iconv impl