Skip to content

Commit d1471ab

Browse files
omerrbbulutOmer Bulut
andauthored
fix: remove en_US.UTF-8 from unicode locale fallback list (#1312)
## Summary Remove `en_US.UTF-8` from the fallback locale list used by `set_unicode_locale()`. The current fallback list includes: - `C.UTF-8` - `en_US.UTF-8` - `.UTF-8` This change removes `en_US.UTF-8`, which can introduce unexpected behavior on systems with a different default locale. Closes #1141 Co-authored-by: Omer Bulut <omer.bulut@asisguard.com.tr>
1 parent 768c810 commit d1471ab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/CLI/impl/Encoding_inl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace detail {
3333
#if !CLI11_HAS_CODECVT
3434
/// Attempt to set one of the acceptable unicode locales for conversion
3535
CLI11_INLINE void set_unicode_locale() {
36-
static const std::array<const char *, 3> unicode_locales{{"C.UTF-8", "en_US.UTF-8", ".UTF-8"}};
36+
static const std::array<const char *, 2> unicode_locales{{"C.UTF-8", ".UTF-8"}};
3737

3838
for(const auto &locale_name : unicode_locales) {
3939
if(std::setlocale(LC_ALL, locale_name) != nullptr) {

0 commit comments

Comments
 (0)