From: Bennett, P. <Pat...@in...> - 2006-06-28 22:09:40
|
=20 > -----Original Message----- > From: William S Fulton [mailto:ws...@fu...]=20 > Sent: Wednesday, June 28, 2006 5:37 PM > To: Bennett, Patrick > Cc: swi...@li... > Subject: Re: [Swig-user] Any idea when SWIG will have full=20 > std::wstring support? (specifically for C#) >=20 ... > Unfortunately it isn't an easy type to marshal because=20 > strings sit inbetween being a primitive type and a=20 > non-primitive type and from what I have read wchar is=20 > interpreted differently on different platforms and Microsoft=20 > do not conform to any standard on this .Net's Unicode strings are UTF-16 (at least in Microsoft's implementation). Specifying CharSet=3DCharSet::Unicode in the DllImport attribute will cause the p/invoke marshaller to treat a string as a utf-16 string, so it may be as simple as changing how wchar_t* and std::wstring types are specified in the pinvoke wrappers. Patrick Bennett |