Open Szeraax opened 2 years ago
I've created an example function that takes a reaction name and sends it back as text to the channel.
Emoji's output to utf-8 charset:
Any emojis in output get converted to ascii
Replace: https://github.com/poshbotio/PoshBot/blob/ee1f8908a3a92cdc63444cf36332e958ae034640/PoshBot/Implementations/Discord/DiscordBackend.ps1#L794 with: $Params['ContentType'] = 'application/json;charset=utf-8'
$Params['ContentType'] = 'application/json;charset=utf-8'
This seems similar to the Teams backend solution: https://github.com/poshbotio/PoshBot/blob/ee1f8908a3a92cdc63444cf36332e958ae034640/PoshBot/Implementations/Teams/TeamsBackend.ps1#L247
Write-Output "Emoji: ❗"
I am trying to have non-ascii characters get preserved when they get posted to Discord
@Szeraax Thanks for the issue and the suggested fix. This should be fixed in da076e71f73e58cbbbffca87b39093f69ccd74b0.
Example:
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](https://user-images.githubusercontent.com/6242511/140795083-d58374ed-d4b0-4233-9285-a7aa2c3b6e0e.png)
Current Behavior
Any emojis in output get converted to ascii
Possible Solution
Replace: https://github.com/poshbotio/PoshBot/blob/ee1f8908a3a92cdc63444cf36332e958ae034640/PoshBot/Implementations/Discord/DiscordBackend.ps1#L794 with:
$Params['ContentType'] = 'application/json;charset=utf-8'
This seems similar to the Teams backend solution: https://github.com/poshbotio/PoshBot/blob/ee1f8908a3a92cdc63444cf36332e958ae034640/PoshBot/Implementations/Teams/TeamsBackend.ps1#L247
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