Skip to content

string.IndexOf bug when using Thai culture #75616

Closed

Description

How to reproduce:

Create a net472 Console project and paste the following code:

using System;
using System.Globalization;
using System.Threading;
public class Program
{
    public static void Main()
    {
        Thread.CurrentThread.CurrentCulture = new CultureInfo("th-th");
        Console.WriteLine("#".IndexOf("["));
    }
}

Output (as expected): -1

Switch the .csproj to net6 TFM and run again.

Output (not expected): 0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions