aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmithx <smithx@pm.me>2019-05-18 22:55:09 +0300
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2019-07-22 19:11:21 +0100
commit03f77453643e936575b4ed2e3b3539749d2c03b5 (patch)
tree6c0b89414631074fcc45b3c57bb95a1e796f7378
parent8f6d97ab8c97295fc74fac05f45f27c91884690a (diff)
downloadswig-03f77453643e936575b4ed2e3b3539749d2c03b5.tar.gz
fix undesirable `wstring` encoding at return value marshalling for C#
-rw-r--r--Lib/csharp/std_wstring.i5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/csharp/std_wstring.i b/Lib/csharp/std_wstring.i
index b18a2cca4..162b90e80 100644
--- a/Lib/csharp/std_wstring.i
+++ b/Lib/csharp/std_wstring.i
@@ -63,7 +63,10 @@ class wstring;
// const wstring &
%typemap(ctype, out="void *") const wstring & "wchar_t *"
-%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]") const wstring & "string"
+%typemap(imtype,
+ inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]",
+ outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]"
+ ) const wstring & "string"
%typemap(cstype) const wstring & "string"
%typemap(csdirectorin) const wstring & "$iminput"