From 2b0ecc2979b6bbe0c017045199ea10873caedd65 Mon Sep 17 00:00:00 2001 From: Noraa Junker Date: Sun, 7 Dec 2025 19:36:05 +0100 Subject: [PATCH] Quick accent character set fixes (#43504) ## Summary of the Pull Request * Fix double uppercase theta character * Fix some redundant special symbols ## PR Checklist - [x] Closes: #43457 #43137 #41570 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx --- .../poweraccent/PowerAccent.Core/Languages.cs | 7 +++---- .../poweraccent/PowerAccent.Core/PowerAccent.cs | 17 +++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/modules/poweraccent/PowerAccent.Core/Languages.cs b/src/modules/poweraccent/PowerAccent.Core/Languages.cs index 2917feff91..73dca3ee72 100644 --- a/src/modules/poweraccent/PowerAccent.Core/Languages.cs +++ b/src/modules/poweraccent/PowerAccent.Core/Languages.cs @@ -230,7 +230,7 @@ namespace PowerAccent.Core LetterKey.VK_SLASH_ => new[] { "÷", "√" }, LetterKey.VK_DIVIDE_ => new[] { "÷", "√" }, LetterKey.VK_MULTIPLY_ => new[] { "×", "⋅" }, - LetterKey.VK_PLUS => new[] { "≤", "≥", "≠", "≈", "≙", "⊕", "⊗", "∓", "≅", "≡" }, + LetterKey.VK_PLUS => new[] { "≤", "≥", "≠", "≈", "≙", "⊕", "⊗", "±", "≅", "≡", "₊", "⁺" }, LetterKey.VK_BACKSLASH => new[] { "`", "~" }, _ => Array.Empty(), }; @@ -546,10 +546,9 @@ namespace PowerAccent.Core LetterKey.VK_E => new[] { "é", "ê", "€" }, LetterKey.VK_I => new[] { "í" }, LetterKey.VK_O => new[] { "ô", "ó", "õ", "º" }, - LetterKey.VK_P => new[] { "π" }, LetterKey.VK_S => new[] { "$" }, LetterKey.VK_U => new[] { "ú" }, - LetterKey.VK_COMMA => new[] { "≤", "≥", "≠", "≈", "≙", "±", "₊", "⁺", "“", "”", "‘", "’", "«", "»" }, + LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’", "«", "»" }, _ => Array.Empty(), }; } @@ -728,7 +727,7 @@ namespace PowerAccent.Core LetterKey.VK_Y => new[] { "ױ" }, LetterKey.VK_COMMA => new[] { "”", "’", "'", "״", "׳" }, LetterKey.VK_PERIOD => new[] { "\u05ab", "\u05bd", "\u05bf" }, - LetterKey.VK_MINUS => new[] { "–", "־" }, + LetterKey.VK_MINUS => new[] { "־" }, _ => Array.Empty(), }; } diff --git a/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs b/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs index d538d5d139..4811118adb 100644 --- a/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs +++ b/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs @@ -358,20 +358,21 @@ public partial class PowerAccent : IDisposable public static string[] ToUpper(string[] array) { - string[] result = new string[array.Length]; + List result = new(array.Length); for (int i = 0; i < array.Length; i++) { switch (array[i]) { - case "ß": result[i] = "ẞ"; break; - case "ǰ": result[i] = "J\u030c"; break; - case "ı\u0307\u0304": result[i] = "İ\u0304"; break; - case "ı": result[i] = "İ"; break; - case "ᵛ": result[i] = "ⱽ"; break; - default: result[i] = array[i].ToUpper(System.Globalization.CultureInfo.InvariantCulture); break; + case "ß": result.Add("ẞ"); break; + case "ǰ": result.Add("J\u030c"); break; + case "ı\u0307\u0304": result.Add("İ\u0304"); break; + case "ı": result.Add("İ"); break; + case "ᵛ": result.Add("ⱽ"); break; + case "ϑ": break; + default: result.Add(array[i].ToUpper(CultureInfo.InvariantCulture)); break; } } - return result; + return [..result]; } }