[PT Run - Calculator plugin] Normalize input before processing (#15131)

This commit is contained in:
Stefan Markovic 2021-12-24 15:59:45 +01:00 committed by GitHub
parent 81e0e14008
commit 09e188621c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Text;
using ManagedCommon; using ManagedCommon;
using Wox.Plugin; using Wox.Plugin;
using Wox.Plugin.Logger; using Wox.Plugin.Logger;
@ -33,7 +34,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
} }
NumberTranslator translator = NumberTranslator.Create(CultureInfo.CurrentCulture, new CultureInfo("en-US")); NumberTranslator translator = NumberTranslator.Create(CultureInfo.CurrentCulture, new CultureInfo("en-US"));
var input = translator.Translate(query.Search); var input = translator.Translate(query.Search.Normalize(NormalizationForm.FormKC));
if (!CalculateHelper.InputValid(input)) if (!CalculateHelper.InputValid(input))
{ {