UTF-8 characters in console output are garbled codes in PyCharm
Describe the bug
According to JetBrains as we discussed in JetBrains Youtrack, AWS Tool Kit for JetBrains should use winp or winpty instead of runnerw.exe.
To reproduce
- Install AWS Toolkit Plugin in PyCharm;
- Create an "AWS Serverless Application" in PyCharm;
- In
lambda_handler()print any UTF-8 characters, such as:
print('你好')
- Run the "Hello World Function";
Expected behavior Should be "你好" in console.
Screenshots
The output "你好“ in console is like below:

Your Environment
- OS: Windows 10 Pro 20H2
- JetBrains product: PyCharm
- JetBrains product version: 2021.2.1
- AWS Toolkit version: 1.32-212
- SAM CLI version:1.31
- JVM/Python version: Python3.9.7
Sorry, I do not have access to that YouTrack link
Hi @abrooksv ,
I have attached a screenshot of the JetBrains staff reply below:

In Run tool window of PyCharm, I can see the commands AWS Toolkit use is:
C:\Users\{my name}\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\212.5080.64\bin\runnerw.exe "C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" local invoke HelloWorldFunction --template D:\Repos\Mine\PycharmBugDemo\.aws-sam\build\template.yaml --event "C:\Users\{my name}\AppData\Local\Temp\[Local] HelloWorldFunction-event4.json"
It appears to me that the garbled codes are caused by “runnerw.exe”, since if I use the below command in PyCharm terminal, the output is correct:
"C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" local invoke HelloWorldFunction --template D:\Repos\Mine\PycharmBugDemo\.aws-sam\build\template.yaml --event "C:\Users\{my name}\AppData\Local\Temp\[Local] HelloWorldFunction-event4.json"
The only difference between the 2 commands, is the latter did not use "runnerw.exe".
And they just deprecated the API 😄 https://github.com/JetBrains/intellij-community/commit/81f5e713926bfa42fb4f078f98c735b8ed1a39fd
This should be fixed now in 1.34, please reopen if still seeing issues
Hi @abrooksv , I have upgrade AWS Toolkit to 1.35-212, but this issue still exist as below image shown.

If I run the same command in PyCharm terminal window, there is no such issue as blow image shown:

We removed the wrapper process, but we can take another look.