Skip to content
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

Can't send non-Latin text with Send-SlackMessage #101

Open
moigagoo opened this issue Dec 17, 2019 · 1 comment
Open

Can't send non-Latin text with Send-SlackMessage #101

moigagoo opened this issue Dec 17, 2019 · 1 comment

Comments

@moigagoo
Copy link

Trying to send a message with Cyrillic characters. All characters are replaced with ? in Slack.

Apparently, this is because the default encoding in PowerShell Core nowadays is UTF-8, but the module encodes the text with iso-8859-1.

@tats-u
Copy link

tats-u commented Jan 8, 2020

Invoke-RestMethod @ProxyParam -Method Post -Body $json -Uri $Uri

Appending the option -ContentType "application/json; charset=utf-8" may fix this issue.

Invoke-RestMethod -Method Post -Uri "https://hooks.slack.com/services/[snip]" -Body "{'text': 'Test message / テストメッセージ / Тестовое сообщение'}" -ContentType "application/json; charset=utf-8"

worked in PowerShell 6 in Ubuntu and 5 in Windows 10 (chcp 932).

@tats-u tats-u mentioned this issue Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants