microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
22.96k stars 1.43k forks source link

Unicode command-line argument parsing #2411

Open MathiasMagnus opened 2 years ago

MathiasMagnus commented 2 years ago

Brief description of your issue

When I copy-paste the exact name of a package as reported by search containing Unicode characters, I can't install it.

Steps to reproduce

PS C:\Users\mate> winget search opencl
Name                                   Id           Version Source
--------------------------------------------------------------------
OpenCL™ and OpenGL® Compatibility Pack 9NQPSL29BFFF Unknown msstore
PS C:\Users\mate> winget install 'OpenCL™ and OpenGL® Compatibility Pack'
No package found matching input criteria.

Expected behavior

Have the package actually install

Actual behavior

CLI bails out

Environment

Windows Package Manager (Preview) v1.4.2011-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22000.795
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.2011.0
Trenly commented 2 years ago

I think it may be an issue specifically with the Trademark sign, as I see this in my logs -

{"Filters":[{"PackageMatchField":"Market","RequestMatch":{"KeyWord":"US","MatchType":"CaseInsensitive"}}],"Query":{"KeyWord":"OpenCLTM and OpenGL® Compatibility Pack","MatchType":"Substring"}}

WinGet-2022-08-03-16-17-30.945.log

The log shows the proper characters in the invocation, and if I do just winget search "OpenGL® Compatibility Pack" I get the result as expected.