Watch
2
0
Fork
You've already forked raylib-cs
0

Use StringToHGlobalAnsi for UTF8Buffer

rather then StringToCoTaskMemUTF8
tested on Windows 11 (x64) & Arch Linux (x64)
should fix #172
This commit is contained in:
Ben Parsons 2023-07-24 22:39:58 +10:00
commit aef7b223e1

View file

@ -13,7 +13,7 @@ namespace Raylib_cs
public UTF8Buffer(string text) public UTF8Buffer(string text)
{ {
data = Marshal.StringToCoTaskMemUTF8(text); this.data = Marshal.StringToHGlobalAnsi(text);
} }
public unsafe sbyte* AsPointer() public unsafe sbyte* AsPointer()
@ -23,7 +23,7 @@ namespace Raylib_cs
public void Dispose() public void Dispose()
{ {
Marshal.FreeCoTaskMem(data); Marshal.FreeHGlobal(data);
} }
} }