dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] String marshalling


From: Marcus
Subject: Re: [Pnet-developers] String marshalling
Date: Sun, 11 Sep 2005 00:08:14 -0500
User-agent: KMail/1.8.91

According to my docs, CharSet.Unicode will ``Marshal strings as Unicode 2-byte 
characters.''

Under Windows, using the CharSet attribute on the DllImport affects all string 
arguments. It is also possible to use the MarshalAs attribute if you want 
affect how strings are marshaled on a per-parameter basis.

Another consideration in that using CharSet on a Dllimport attribute is 
supposed to cause a "W" or "A" to be appended to the entry point name, at 
least under Windows.



On Saturday 10 September 2005 5:11 am, Marc Haisenko wrote:
> On Saturday 10 September 2005 06:15, Marcus wrote:
> > How would you set the charset to UTF-8 in the DllImport attribute? UTF-16
> > I see, but I do not see UTF-8 as an option.
>
> [DllImport ("foo", CharSet=CharSet.Unicode)]
>
> This marshalls as UTF-8... but *I* don't see an option for UTF-16 ? :-)
> C'ya,
>       Marc


reply via email to

[Prev in Thread] Current Thread [Next in Thread]