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

Writing emojis to Discord backend converts to ascii #237

Open
Szeraax opened this issue Nov 8, 2021 · 1 comment
Open

Writing emojis to Discord backend converts to ascii #237

Szeraax opened this issue Nov 8, 2021 · 1 comment

Comments

@Szeraax
Copy link
Contributor

Szeraax commented Nov 8, 2021

My case

I've created an example function that takes a reaction name and sends it back as text to the channel.

Desired Behavior

Emoji's output to utf-8 charset:
image

Current Behavior

Any emojis in output get converted to ascii

image

Possible Solution

Replace:

if (-not $Params['ContentType']) {$Params['ContentType'] = 'application/json'}

with:
$Params['ContentType'] = 'application/json;charset=utf-8'

This seems similar to the Teams backend solution:

ContentType = 'application/json;charset=utf-8'

Steps to Reproduce (for bugs)

Write-Output "Emoji: ❗"

Context

I am trying to have non-ascii characters get preserved when they get posted to Discord

Your Environment

  • Module version used: latest
  • Operating System and PowerShell version: Posh 7.1 on windows 10
@devblackops
Copy link
Member

@Szeraax Thanks for the issue and the suggested fix. This should be fixed in da076e7.

Example:
Screen Shot 2021-11-09 at 10 54 04 PM

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