We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug All the Chinese parts included in Python scripts are garbled
To Reproduce Matching configuration is as follows
matches: - trigger: ":py" replace: "{{output}}" vars: - name: output type: script params: args: - python - "%CONFIG%/scripts/scripts.py"
scripts.py The contents are as follows
import sys if __name__ == "__main__": print(f"python 脚本参数:{sys.argv}")
Screenshots
Logs If possible, run espanso log in a terminal after the bug has occurred, then post the output here so that we can better diagnose the problem
espanso log
Setup information
espanso --version
The text was updated successfully, but these errors were encountered:
This issue is identical to #1749. This is not an expanso bug, but the way your python script produce the output. Check my answer.
Try the following scripts.py
scripts.py
import sys def print_utf8(s): sys.stdout.buffer.write(s.encode('utf8')) if __name__ == "__main__": print_utf8(f"python 脚本参数:{sys.argv}")
Sorry, something went wrong.
This issue is identical to #1749. This is not an expanso bug, but the way your python script produce the output. Check my answer. Try the following scripts.py import sys def print_utf8(s): sys.stdout.buffer.write(s.encode('utf8')) if __name__ == "__main__": print_utf8(f"python 脚本参数:{sys.argv}")
Thank you very much, the solution you provided does work!
The problem has been solved
No branches or pull requests
Describe the bug
All the Chinese parts included in Python scripts are garbled
To Reproduce
Matching configuration is as follows
scripts.py The contents are as follows
Screenshots
![image](https://private-user-images.githubusercontent.com/26438145/266223605-20c0fbe5-53f4-48b7-a203-7028c2bcb587.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwMDgyNTIsIm5iZiI6MTcyMDAwNzk1MiwicGF0aCI6Ii8yNjQzODE0NS8yNjYyMjM2MDUtMjBjMGZiZTUtNTNmNC00OGI3LWEyMDMtNzAyOGMyYmNiNTg3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAzVDExNTkxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg0ZGU2ZGM3NTg4NmQxNWVmYjIwNWZkOTdmOGEyMWI5MDdhMzlmNDk5YjIyNTIwYjcwZTIxMzA0NDFiZDlmODEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.4JCVQElaJACIYQ8AFYG6ujUahq6Y68PczVpSuvifBY8)
Logs
If possible, run
espanso log
in a terminal after the bug has occurred, then post the output here so that we can better diagnose the problemSetup information
espanso --version
inside a terminal)The text was updated successfully, but these errors were encountered: