Skip to content

Commit

Permalink
Use StringToHGlobalAnsi for UTF8Buffer (#173)
Browse files Browse the repository at this point in the history
Rather then StringToCoTaskMemUTF8.
Tested on Windows 11 (x64) & Arch Linux (x64).
Should fix #172
  • Loading branch information
9ParsonsB committed Jul 24, 2023
1 parent d73f5d8 commit e6ac656
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Raylib-cs/types/native/UTF8Buffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Raylib_cs

public UTF8Buffer(string text)
{
data = Marshal.StringToCoTaskMemUTF8(text);
this.data = Marshal.StringToHGlobalAnsi(text);
}

public unsafe sbyte* AsPointer()
Expand All @@ -23,7 +23,7 @@ public UTF8Buffer(string text)

public void Dispose()
{
Marshal.FreeCoTaskMem(data);
Marshal.FreeHGlobal(data);
}
}

Expand Down

0 comments on commit e6ac656

Please sign in to comment.