Skip to content

Conversation

@simonrozsival
Copy link
Member

I was having trouble building Xamarin.Android on my PC because the generated C# code wouldn't compile. The identifiers checked, decimal, and delegate wheren't prefixed with @. I later found out that this was happening because Windows on my PC had Region format set to Czech. We have this weird letter "ch" which is actually the 9th letter of our alphabet. Therefore, the required_keywords array isn't sorted correctly when the culture is cs-CZ since it contains the word "checked" and Array.BinarySearch wasn't working correctly for me because it utilized the default culture-specific string comparer. This PR explicitly sets the string comparer for binary search to Ordinal which solves the problem.

Copy link
Contributor

@jpobst jpobst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunate that .NET's string analyzers (or our usage of them) didn't find this:
#879

LGTM, thanks!

@jonpryor
Copy link
Contributor

jonpryor commented May 3, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonpryor jonpryor merged commit 61cdb40 into dotnet:main May 4, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants