New issue
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
Espanso does not support UTF-8 return values from PowerShell #1736
Comments
Apart from the fact that the recommended way of using nested matches is as documented in https://espanso.org/docs/matches/basics/#nested-matches, your problem may relate to the return of non-English characters from Windows shells and Python, as also noted in Issue #1749. |
I don't use this as a way of using nested matches, this was only a quick proof of concept to show that regular triggers are able to return "é" but not from a powershell return.
Yes, that is what I implied in the title, sorry if that wasn't clear. |
Fair enough - thank you. I primarily wanted to link your Issue with the later one. |
This is the same issue as #1749. You need to tell PowerShell to operate in UTF8. You can do this permanently (in your config) or you can change the encoding just for your command, like this : - trigger: ":ps"
replace: "{{text}}"
vars:
- name: text
type: shell
params:
cmd: |
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8;
return "é" or you can use |
Hey, thanks a lot for the workaround !
When you're saying this, do you mean by adding
I can't because everything I'm running was written in powershell so I might aswell run it directly in powershell, but thanks for the suggestion :-) |
This is one possibility, but it's not without its drawbacks : check this discussion. |
I can confirm this does work ! I don't know if I should close this issue though as I think it should be mentioned in the docs. |
If this is your request now, and you decide to keep it open, you should probably change the title to something like "Missing documentation about UTF-8 support in PowerShell" and change the label from There is already an open issue #1788 that mention the UTF-8 documention problem. |
Describe the bug
Espanso does not accept return values from PowerShell (I have not tested with other shells).
Using the config below, the
:ps_é
trigger returns an unknown character (�)To Reproduce
:ps_é
Config
I have also tried using
return $([char]0x00E9)
to no avail.Expected behavior
Both
:é
and:ps_é
return "é"Screenshots
N/A
Logs
Setup information
The text was updated successfully, but these errors were encountered: