C# CreateWStringFromUTF32 optimisation

Avoid UTF-32 to UTF-8 conversion then get string from UTF-8
Missing change that should have gone into eaf468e9e8
This commit is contained in:
William S Fulton 2022-09-30 23:21:39 +01:00
commit 929cfde883

View file

@ -101,9 +101,7 @@ static SWIG_CSharpWStringExceptionHelperCallback SWIG_csharp_ApplicationExceptio
return string.Empty;
byte[] buffer = new byte[length * 4];
global::System.Runtime.InteropServices.Marshal.Copy(cString, buffer, 0, buffer.Length);
byte[] utf8buffer = global::System.Text.Encoding.Convert(global::System.Text.Encoding.UTF32, global::System.Text.Encoding.UTF8, buffer);
return global::System.Text.Encoding.Default.GetString(utf8buffer);
return global::System.Text.Encoding.UTF32.GetString(buffer);
}
static void SetPendingApplicationExceptionUTF16([global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]global::System.IntPtr cString, int length) {