Skip to content

[PTRun][UnitConverter] Use invariant casing for degree unit tokens - #50414

Open
cui fliter (cuishuang) wants to merge 1 commit into
microsoft:mainfrom
cuishuang:main
Open

[PTRun][UnitConverter] Use invariant casing for degree unit tokens#50414
cui fliter (cuishuang) wants to merge 1 commit into
microsoft:mainfrom
cuishuang:main

Conversation

@cuishuang

@cuishuang cui fliter (cuishuang) commented Sep 6, 2026

Copy link
Copy Markdown

Summary of the Pull Request

Fixes culture-sensitive parsing of CELSIUS and FAHRENHEIT in the PowerToys Run Unit Converter.

DegreePrefixer() was using ToLower(CultureInfo.CurrentCulture) for fixed English unit tokens. In tr-TR, uppercase I is lowercased to the dotless ı, causing inputs such as CELSIUS and FAHRENHEIT to miss their expected branches.

The implementation now uses ToLowerInvariant() for both unit tokens.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Updated DegreePrefixer() so internal English unit tokens are normalized independently of the user's current culture.

Added PrefixesDegreesWithTurkishCulture, which sets CultureInfo.CurrentCulture to tr-TR and verifies that:

  • CELSIUS becomes DegreeCelsius
  • FAHRENHEIT becomes DegreeFahrenheit

The test restores the original culture in a finally block.

Validation Steps Performed

  • git diff --check passed.
  • Verified that Turkish casing produces celsıus and fahrenheıt.
  • Added a regression test for tr-TR.
  • The PowerToys unit test project could not be executed in this macOS environment because the required Windows/.NET Visual Studio build environment is unavailable.

Signed-off-by: cuishuang <imcusg@gmail.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added Product-PowerToys Run Improved app launch PT Run (Win+R) Window Ready for review labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

🧭 PR intake

Visual evidence: Not needed — The changed files do not indicate a visible UI change. No visual evidence is expected.

Recommendation

Link the issue this PR fixes using a closing keyword such as Closes #123.

✅ Ready for review

This PR passed the automated intake checks and is ready for maintainer review.

Automated PR intake; PowerToys maintainers make final decisions.

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

Labels

Product-PowerToys Run Improved app launch PT Run (Win+R) Window Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant