Skip to content
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

string.IndexOf() on Thai Culture , Windows11, 64 bits, .net5,6,7,8, return incorrect index #100381

Open
enginekit opened this issue Mar 28, 2024 · 2 comments
Labels
area-System.Globalization untriaged New issue has not been triaged by the area owner

Comments

@enginekit
Copy link

enginekit commented Mar 28, 2024

using System.Globalization;
CultureInfo.CurrentCulture = new CultureInfo("th-TH");
string line = "/a#name:";
int a = line.IndexOf("a");
int b = line.IndexOf("#");
Console.WriteLine($"a: {a}, b: {b}"); 
//a =1, but b =0, !

using System.Globalization;

CultureInfo.CurrentCulture = new CultureInfo("en-us");
string line = "/a#name:";
int a = line.IndexOf("a");
int b = line.IndexOf("#");
Console.WriteLine($"a: {a}, b: {b}"); // Expected output: a: 1, b: 2
//a =1, b =2, correct

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Mar 28, 2024
@huoyaoyuan
Copy link
Member

Related to #87939

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Globalization untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

2 participants