Add note about wchar_t marshalling fix required for Windows

This commit is contained in:
William S Fulton 2019-07-24 21:51:52 +01:00
commit 15a0681b11
2 changed files with 5 additions and 2 deletions

View file

@ -99,7 +99,10 @@ public class runme
check_equal(received, expected);
}
/* Not working on Windows okay on Linux
/* Not working for Japanese and Russian characters on Windows, okay on Linux
* Is fixed by adding CharSet=CharSet.Unicode to the DllImport, so change to:
* [global::System.Runtime.InteropServices.DllImport("li_std_wstring", CharSet=global::System.Runtime.InteropServices.CharSet.Unicode, EntryPoint="CSharp_li_std_wstringNamespace_test_wcvalue")]
* Needs a SWIG code change to support this
foreach (string test_string in test_strings)
{
foreach (char expected in test_string)

View file

@ -53,7 +53,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterWStringCallback_$module(SWIG_CSharpWStri
// wchar_t
%typemap(ctype) wchar_t "wchar_t"
%typemap(imtype) wchar_t "char"
%typemap(imtype) wchar_t "char" // Requires adding CharSet=CharSet.Unicode to the DllImport to correctly marshal Unicode characters
%typemap(cstype) wchar_t "char"
%typemap(csin) wchar_t "$csinput"