Hi,
I have a Powershell Studio project with a gridview box. That works fine but gives weird characters when running the project as exe. As an ps1 it works fine.
Screenshot: https://1drv.ms/u/s!AuBjpW9I3NC4m_8skUS ... g?e=aaiHQd
Or:
What I get, as example (see the ΓÇ and ª characters) :
=> Microsoft Visual C++ 2015-2019 Redistributable (x8ΓÇ ª Microsoft.VC++2015-2019Redist-x86
What I should get:
=> Microsoft Visual C++ 2015-2019 Redistributable (x8… Microsoft.VC++2015-2019Redist-x86
Now I think it is linked to [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
which doesn't work within the exe
Please advise
S
PS Studio: weird characters in gridview via exe (not via scipt)
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: PS Studio: weird characters in gridview via exe (not via scipt)
To help you better we need some information from you.
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build:
Operating system:
PowerShell version(s):
*** Please add details and screenshots as needed below. ***
DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Can you please upload your project and psbuild file here:
https://www.sapien.com/support/upload
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build:
Operating system:
PowerShell version(s):
*** Please add details and screenshots as needed below. ***
DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Can you please upload your project and psbuild file here:
https://www.sapien.com/support/upload
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: PS Studio: weird characters in gridview via exe (not via scipt)
Here is the version info:
Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.166
OS: Windows Server 2016 Standard (64 Bit)
Build: v10.0.14393.0
Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.166
OS: Windows Server 2016 Standard (64 Bit)
Build: v10.0.14393.0
Re: PS Studio: weird characters in gridview via exe (not via scipt)
Can't share the project as is now. Don't also see need or added value as it will be useless since it wont generate any extra info for you while not running the project in my environment.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: PS Studio: weird characters in gridview via exe (not via scipt)
Unfortunately there is not enough information here to evaluate this. Without your files or at the very least a screenshot we cannot determine if you have a GUI project with a grid or if you are using Out-Gridview. A GUI project typically has no console, unless you package it as console application. But we don't know that either without the .psbuild file or some additional information.
We also don't know why or where you change the encoding. A console usually does not use UTF-8, so in order to suggest any workaround more information would be needed.
I will be moving this thread to the PowerShell GUI section.
We also don't know why or where you change the encoding. A console usually does not use UTF-8, so in order to suggest any workaround more information would be needed.
I will be moving this thread to the PowerShell GUI section.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: PS Studio: weird characters in gridview via exe (not via scipt)
Fully agree. That's why I created an example (att.)
This is the output when you just run the code in a Powershell ISE:
Note that you need Windows 10 and Winget (in Windows 10 Appstore) to make this example work.This is the output when you just run the code in a Powershell ISE:
- Attachments
-
- Sapien_Example_WeirdCharacters.psf
- psf
- (15.43 KiB) Downloaded 203 times
Re: PS Studio: weird characters in gridview via exe (not via scipt)
Any update on this? Can't share more details then I did.
Re: PS Studio: weird characters in gridview via exe (not via scipt)
After further testing, the issue appears to be the results returned when running the following:
You will most likely have to filter out those characters yourself.Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.