Closed aquaticus closed 2 years ago
Tagging subscribers to this area: @dotnet/area-system-globalization See info in area-owners.md if you want to be subscribed.
Author: | aquaticus |
---|---|
Assignees: | - |
Labels: | `area-System.Globalization`, `untriaged` |
Milestone: | - |
Can you please force NLS mode and confirm you get the previous behavior? See
https://learn.microsoft.com/en-us/dotnet/core/compatibility/globalization/5.0/icu-globalization-api
Enabling NLS solves the issue.
Duplicate of #59120, #75616
@aquaticus Thanks for the confirmation. Enabling NLS would probably not be your long term plan. You may want to pass StringComparison.Ordinal
Thanks for the confirmation. Enabling NLS would probably not be your long term plan. You may want to pass StringComparison.Ordinal
Yeah, I need quick solution at the moment. Applying proper patch takes time in my case.
Description
When Thai
th-TH
culture is set for a thread,string.IndexOf(string)
returns always0
if the argument contains full stop character.
(U+002E).This may be specific for Thai script but works as described in documentation for older .NET Core/NetFrameworks.
Reproduction Steps
Expected behavior
"012".IndexOf(".")
returns-1
"01.".IndexOf(".")
returns2
Actual behavior
"012".IndexOf(".")
returns0
"01.".IndexOf(".")
returns0
Regression?
For
it works as documented.
Known Workarounds
Use char type insted of string as an argument for
IndexOf()
, e.g.IndexOf('.')
Configuration
Windows 10 x64
Ubuntu 20 x64
Other information
No response