discord / gamesdk-and-dispatch

Public issue tracker for the Discord Game SDK and Dispatch
22 stars 7 forks source link

For C# apps built in .NET, sdk treats UTF-16 strings as UTF-8 #32

Open LittleEndu opened 4 years ago

LittleEndu commented 4 years ago

Describe the bug When using gamesdk in C# with .NET instead of Unity, all UTF-16 encoded strings are treated as UTF-8 encoded. UTF-16 is the only encoding .NET provides for strings.

Steps to reproduce

  1. Make a .NET application (I made a .NET Core console app)
  2. Write code that utilizes an activity
  3. Special characters come out as ???

Example code: https://gist.github.com/LittleEndu/91771407c51fdbd9bffcd2d891bd4ee9

Expected behavior All characters print out correctly (as äõüöあえいおう★☆⚝✪ on the screenshot)

Screenshots 2020-03-24 21_04_18-#newchannel-xd - Discord

Implementation specifics

Additional context I reported it in sdk server 5 months ago, Mason back then confirmed that this doesn't happen in Unity.

sylveon commented 4 years ago

The solution would most likely be to use the UTF8Encoding class before sending the string.