Use libcharset instead of nl_langinfo(CODESET) if possible.