[Mono-dev] UnmanagedType.LPWStr and Big-Endian Unicode

Kornél Pál kornelpal at gmail.com
Sat Aug 12 05:44:17 EDT 2006


Hi,

On big-endian machines everything is big-endian, including P/Invoke. In fact 
there is no need to big-endian conversion because managed strings are 
big-endian on big-endian machines. They are converted when they are read 
from your assembly files.

Only things documented to be little-endian are little-endian on big-endian 
machines.

For more information have a look at
http://lists.ximian.com/pipermail/mono-devel-list/2005-December/016352.html

Kornél

----- Original Message ----- 
From: "Dmitry Key" <dmitryskey at hotmail.com>
To: <mono-devel-list at lists.ximian.com>
Sent: Saturday, August 12, 2006 11:14 AM
Subject: [Mono-dev] UnmanagedType.LPWStr and Big-Endian Unicode


> Hi
>
> One has the following function declaration:
>
> [DllImport("libSQLDBC_C")]
> public unsafe extern static SQLDBC_Retcode
> SQLDBC_PreparedStatement_prepareNTS(
> IntPtr stmt,
> [MarshalAs(UnmanagedType.LPWStr)]string query,
> SQLDBC_StringEncodingType encoding);
>
> It is obvious that for the Little-Endian hardware the string "query" will 
> be
> translated to the Little-Endian null-terminated Unicode string. But what
> happens for the Big-Endian architecture? I could not find answer for this
> question in the Mono documention.
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list 




More information about the Mono-devel-list mailing list