diff options
Diffstat (limited to 'Lib/csharp/wchar.i')
-rw-r--r-- | Lib/csharp/wchar.i | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/csharp/wchar.i b/Lib/csharp/wchar.i index 39b99ee22..f1e0d5a26 100644 --- a/Lib/csharp/wchar.i +++ b/Lib/csharp/wchar.i @@ -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) { |