Repository navigation
Conversation
With no locale argument these use the environment's locale. When LANG is
unset (Docker images, chroots, some services) that is "C", which only maps
ASCII case, so ofToLower("É") returned "É" and the strings test failed on a
bare Ubuntu 24.04 container. If the locale maps no non-ASCII case, fall back
to C.UTF-8 (part of glibc's libc-bin), C.utf8 or en_US.UTF-8.
A locale passed explicitly is still used as is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ofToLower/ofToUpper(and the othergetLocale()users) take the environment's locale when no locale is passed. WithLANGunset (Docker images, chroots, some services) that isC, which only maps ASCII case:This failed
tests/utils/strings(tolower,toupper) when testing #8540 in a bareubuntu:24.04container. GitHub's runners set a UTF-8LANG, so CI never hit it.Change: in
getLocale(), if no locale was asked for and the resulting locale doesn't lowercaseÉ, fall back toC.UTF-8,C.utf8, thenen_US.UTF-8. It checks the behaviour rather thanlocale.name(), because macOS libc++ reports an empty name both with and withoutLANG. An explicitly passed locale is used unchanged. The MinGW branch is untouched.No package is needed:
C.utf8ships in glibc'slibc-bin.Tested
LANGunset: beforetolower(É)=É(fail), after =é(pass); withLANG=C.UTF-8, unchanged.tests/utils/stringsbuilt with make and run withenv -i(noLANG): 43/43 passed; withLANG=en_US.UTF-8: 43/43 passed.