Skip to content

ToUpper not working as intended with Turkish Culture #77689

@sencagri

Description

@sencagri

Description

In our tests ToUpper() method returns false characters. The lowercase "i" character should be "İ" but we are getting "I" only in .NET MAUI apps. Other project types are working fine.

Steps to Reproduce

  1. Create a new .NET MAUI project (.Net 6 or preview both are same)
  2. We have added CodePages nuget (System.Text.Encoding.CodePages)
  3. Add the following code at MauiProgram.cs
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); // don't know if this helps, just tried...
            CultureInfo tr = new CultureInfo("tr-TR", false);
            string test = "i";
            var test2 = test.ToUpper(tr);
            var testResult = test2 == "İ"; // result is false because test2 is "I" instead of "İ"

Link to public reproduction project repository

https://github.com/sencagri/MauiAppToUpper

Version with bug

7.0 Release Candidate 2

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

All android versions

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions