-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Fix culture creation with undetermined lang tag #115166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tarekgh
merged 1 commit into
dotnet:main
from
tarekgh:FixCultureCreationWithUndeterminedLangTag
Apr 30, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a test for
und-fonipa
? That's a common tag for IPA, referenced on Wikipedia for example: https://en.wikipedia.org/wiki/International_Phonetic_Alphabet#IETF_language_tagsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunetly, Windows currently doesn't allow using this name. You can try the code:
and you will see
GetLocaleInfoEx: 0 ... Error Code: 87
. 87 meansThe parameter is incorrect
.I would suggest you log issue for Windows through Windows Feedback hub. If Windows fixes that, it will automatically work with .NET.
By the way, if you run on Linux, this should work fine with the current fix here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xadxura may help with this too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows requires the script tag to be declared unless a suppress-script value is defined for that langauge in BCP-47. The language tag 'und' has no suppress script defined so the script must be declared. One could say taht und-fonipa implicitly declares the script from the variant tag fonipa however we don't allow leftward propagation of script info. This is also why we don't infer Hans from zh-CN. Please use the tag und-Latn-fonipa, which does work with Windows:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xadxura I am seeing Windows don't allow
und-Latn-fonipa
when callingGetLocaleInfoEx
. Am I missing something? shouldund-Latn-fonipa
need to get registered on Windows before using this tag?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @tarekgh and @xadxura. Duh, I knew that Windows needed
Latn
but just plain forgot when asking here. Sorry for the side-track. But it sounds likeund-Latn-fonipa
still has an open question.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, custom BCP-47 tags must be registered on the system first.