Fix BigInteger UTF-8 parsing with Ukrainian culture NBSP handling #123783
+128
−3
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.
Description
BigInteger parsing fails for UTF-8 byte arrays with Ukrainian culture (uk-UA) when using
NumberStyles.AllowThousands. Ukrainian uses NBSP (U+00A0) asNumberGroupSeparator, but users type regular space (U+0020).The
MatchCharsfunction inNumber.Parsing.Common.cshad incomplete space equivalence logic:Changes
Core parsing (
Number.Parsing.Common.cs):Testing (
parse.ukUA.cs):Example
Original prompt
This section details on the original issue you should resolve
<issue_title>System.Numerics.Tests.parseTest.RunParseToStringTests(culture: uk-UA) test failures</issue_title>
<issue_description>This test runs as part of the libraries outer loop.
Hit in #119427. Log file: https://helixr1107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-119427-merge-e179d39d041e4c21b3/System.Runtime.Numerics.Tests/1/console.8967a987.log?skoid=8eda00af-b5ec-4be9-b69b-0919a2338892&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2025-10-01T01%3A05%3A30Z&ske=2025-10-01T02%3A05%3A30Z&sks=b&skv=2024-11-04&sv=2024-11-04&st=2025-10-01T01%3A05%3A30Z&se=2025-10-01T02%3A05%3A30Z&sr=c&sp=r&sig=7IW6R8WrZP0cNbaHbzQaVlxd8lGUkdAbHB4%2BpInETpk%3D