From c764309ae509a311ccd1b6428ad05cb4bbec6037 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Wed, 7 Feb 2018 11:44:56 -0500 Subject: [PATCH] Dear CoreCLR team: Please fix this --- src/SDL2.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/SDL2.cs b/src/SDL2.cs index ce6ad79..c2cdf79 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -68,6 +68,19 @@ namespace SDL2 ptr++; } + /* TODO: This #ifdef is only here because the equivalent + * .NET 2.0 constructor appears to be less efficient? + * Here's the pretty version, maybe steal this instead: + * + string result = new string( + (sbyte*) s, // Also, why sbyte??? + 0, + (int) (ptr - (byte*) s), + System.Text.Encoding.UTF8 + ); + * See the CoreCLR source for more info. + * -flibit + */ #if NETSTANDARD2_0 /* Modern C# lets you just send the byte*, nice! */ string result = System.Text.Encoding.UTF8.GetString(