Use locale_charset (from libcharset) instead of nl_langinfo directly.