AndreiV
February 3, 2022, 12:38pm
1
Hello
The function mentioned in the subject (Get-InstalledApplication), line 2237:
$appDisplayName = $regKeyApp.DisplayName -replace ‘[^\u001F-\u007F]’,’’
This removes unicode characters that should be there. This is the function output:
DisplayName : Adobe Acrobat Reader DC - Franais
This is the correct display name:
Toolkit Version: 3.8.4
That line was added because of this:
opened 03:56AM - 18 Dec 18 UTC
closed 06:02AM - 24 Apr 20 UTC
bug
resolved / implemented
I have Russion version of Windows, Office, Visio, etc.
`PS D:\UninstallAllVis… io\AppDeployToolkit> Import-Module .\AppDeployToolkitMain.ps1
PS D:\UninstallAllVisio\AppDeployToolkit> (Get-InstalledApplication -Name "Microsoft Visio").DisplayName`
Microsoft Visio 2016
Microsoft Visio Professional 2016
Microsoft Visio MUI (Russian) 2016
But in registry I have this:
Microsoft Visio профессиональный 2016
Microsoft Visio Professional 2016
Microsoft Visio MUI (Russian) 2016
I think problem in this part of function:
` ## Remove any control characters which may interfere with logging and creating file path names from these variables
$appDisplayName = $regKeyApp.DisplayName -replace '[^\u001F-\u007F]',''
$appDisplayVersion = $regKeyApp.DisplayVersion -replace '[^\u001F-\u007F]',''
$appPublisher = $regKeyApp.Publisher -replace '[^\u001F-\u007F]',''`
.
Comment out that line to see if it works for you.
Personally I would have swapped the accents out (ç → c) but that’s more code.
According to this: https://www.unicode.org/charts/PDF/U0000.pdf
control characters are 00 → 1F + 7F
I’m not sure the existing code replaces only 2 characters or a range.
If you can figure out code will leave the accent characters in and not break the function, you should try to file a bug report (or I can do it for you) and include your new code.
I understand. OK, I’ll have a look and see if I can find a solution.
Will keep you updated here.
1 Like
I have a possible solution:
The code is:
-replace “[^\p{L}\p{Nd}\p{Z}\p{P}]”,’’
The inspiration:
Regex Tutorial - Unicode Characters and Properties (regular-expressions.info)
I created issue #691
Please tell me if the last line of code is accurate.
Thanks.
Yes, the code is accurate:
-replace “[^\p{L}\p{Nd}\p{Z}\p{P}]”,’’
1 Like