Handle non breaking white spaces in copy paste manager (#1226)

* Handle non breaking white spaces in copy paste manager

* handle other group characters
This commit is contained in:
Eric Wong 2020-05-21 14:08:16 -07:00 committed by GitHub
parent 4f03f995a2
commit 79bd149b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -594,9 +594,11 @@ ULONG32 CopyPasteManager::ProgrammerOperandLength(Platform::String ^ operand, Nu
// Indian rupee(₹) - 8377 // Indian rupee(₹) - 8377
// pound(£) - 163 // pound(£) - 163
// euro(€) - 8364 // euro(€) - 8364
// non-breaking whitespace - 160
Platform::String ^ CopyPasteManager::RemoveUnwantedCharsFromString(Platform::String ^ input) Platform::String ^ CopyPasteManager::RemoveUnwantedCharsFromString(Platform::String ^ input)
{ {
constexpr wchar_t unWantedChars[] = { L' ', L',', L'"', 165, 164, 8373, 36, 8353, 8361, 8362, 8358, 8377, 163, 8364, 8234, 8235, 8236, 8237 }; constexpr wchar_t unWantedChars[] = { L' ', L',', L'"', 165, 164, 8373, 36, 8353, 8361, 8362, 8358, 8377, 163, 8364, 8234, 8235, 8236, 8237, 160 };
input = CalculatorApp::Common::LocalizationSettings::GetInstance().RemoveGroupSeparators(input);
return ref new String(Utils::RemoveUnwantedCharsFromString(input->Data(), unWantedChars).c_str()); return ref new String(Utils::RemoveUnwantedCharsFromString(input->Data(), unWantedChars).c_str());
} }