Use nl_langinfo properly to detect if the charset is utf8