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:
parent
e147f2af69
commit
929cfde883
1 changed files with 1 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue