diff --git a/src/Windowing/Silk.NET.Windowing.Glfw/GlfwWindow.cs b/src/Windowing/Silk.NET.Windowing.Glfw/GlfwWindow.cs index 2e364abcfa..15030d3772 100644 --- a/src/Windowing/Silk.NET.Windowing.Glfw/GlfwWindow.cs +++ b/src/Windowing/Silk.NET.Windowing.Glfw/GlfwWindow.cs @@ -731,7 +731,7 @@ protected override void RegisterCallbacks() for (var i = 0; i < count; i++) { var p = Marshal.ReadIntPtr(paths, i * IntPtr.Size); - arrayOfPaths[i] = Marshal.PtrToStringAnsi(p); + arrayOfPaths[i] = SilkMarshal.PtrToString((nint) p, NativeStringEncoding.UTF8) ?? ""; } FileDrop?.Invoke(arrayOfPaths); diff --git a/src/Windowing/Silk.NET.Windowing.Sdl/SdlWindow.cs b/src/Windowing/Silk.NET.Windowing.Sdl/SdlWindow.cs index 066cecafe7..bb3274c72e 100644 --- a/src/Windowing/Silk.NET.Windowing.Sdl/SdlWindow.cs +++ b/src/Windowing/Silk.NET.Windowing.Sdl/SdlWindow.cs @@ -7,6 +7,7 @@ using System.Runtime.CompilerServices; using Silk.NET.Core; using Silk.NET.Core.Contexts; +using Silk.NET.Core.Native; using Silk.NET.Maths; using Silk.NET.SDL; using Point = System.Drawing.Point; @@ -402,7 +403,8 @@ public override void ProcessEvents() } case EventType.Dropfile: { - _droppedFiles.Add(new string((sbyte*) @event.Drop.File)); + string path = SilkMarshal.PtrToString((nint) @event.Drop.File, NativeStringEncoding.UTF8) ?? ""; + _droppedFiles.Add(path); break; } default: