Commit Graph

1 Commits

Author SHA1 Message Date
Brad King cd408d93fd Add setlocale() calls around use of libarchive APIs (#14934, #15377)
The libarchive APIs use nl_langinfo(CODESET) for iconv so they need the
locale to be set for LC_CTYPE.  However, the rest of CMake does not
define any behavior for non-ASCII character classification/conversion so
we do not want to setlocale() globally.  Add a RAII class to save, set,
and restore the locale around calls to libarchive APIs.

Inspired-by: Clinton Stimpson <clinton@elemtech.com>
2015-02-06 13:32:57 -05:00