You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Noticed by @muellerj2 in #5444 (comment). Windows 11 24H2 recognizes the locale name 'Czech_Czechia.1250' and doesn't recognize 'Czech_Czech Republic.1250'. I wasn't able to figure out when this change happened in Windows (a moderate amount of searching turned up nothing, and I even tried GitHub Copilot but it neither provided consistent answers nor cited any authoritative sources I could confirm), but it seems to have happened a while ago. (Presumably after our Python-powered test harness was added in 2020.)
We can assume/require that contributors and maintainers are running modern builds of Win11, and our CI infrastructure is now using Windows Server 2025, so we should switch to looking for the new locale name here. I believe our MSVC-internal infrastructure isn't using Server 2025 yet, but it doesn't use the Python-powered test harness, so this is irrelevant for it. (It doesn't even understand "REQUIRES" lines.)
Additionally, I have a logic cleanup to simplify how we add locale features. This just uses an if-statement instead of a when-lambda. It also uses a formatted string literal for clarity.
To validate this, I ran the test directories that require the cs_CZ.ISO8859-2 locale:
I see one potential argument to resolve this differently: The locale setup in the test harness seems to have been adapted almost verbatim from libc++'s, so libc++'s test harness suffers from the same bug. If we resolve this issue in the same way as libc++, it might make it a little bit easier to sync changes from upstream in the future.
But I guess it's also a valid argument that the test setups have accumulated so many differences that another minor one doesn't matter.
If you think they have diverged too much, then there isn't much point in trying to keep the code as closely aligned as possible. Your code certainly looks cleaner.
The MSVC STL test harness also appears to be missing some locale-related compile flags that were recently added to libcxx tests, like this one in std\localization\locale.categories\category.monetary\locale.money.get\locale.money.get.members\get_long_double_fr_FR.pass.cpp:
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.
Noticed by @muellerj2 in #5444 (comment). Windows 11 24H2 recognizes the locale name
'Czech_Czechia.1250'
and doesn't recognize'Czech_Czech Republic.1250'
. I wasn't able to figure out when this change happened in Windows (a moderate amount of searching turned up nothing, and I even tried GitHub Copilot but it neither provided consistent answers nor cited any authoritative sources I could confirm), but it seems to have happened a while ago. (Presumably after our Python-powered test harness was added in 2020.)We can assume/require that contributors and maintainers are running modern builds of Win11, and our CI infrastructure is now using Windows Server 2025, so we should switch to looking for the new locale name here. I believe our MSVC-internal infrastructure isn't using Server 2025 yet, but it doesn't use the Python-powered test harness, so this is irrelevant for it. (It doesn't even understand "REQUIRES" lines.)
Additionally, I have a logic cleanup to simplify how we add locale features. This just uses an if-statement instead of a when-lambda. It also uses a formatted string literal for clarity.
To validate this, I ran the test directories that require the
cs_CZ.ISO8859-2
locale:There are 132 total discovered tests here. I then compared
main
, #5444, this PR, and #5444 merged with this PR:main