[Mono-list] string encoding

Mike Kestner mkestner@speakeasy.net
22 Jun 2003 19:17:40 -0500


On Sun, 2003-06-22 at 14:06, Havoc Pennington wrote:

> That leaves no way to marshal functions that take UTF-8 regardless of
> locale as GTK does, but Mono could add some nonstandard extension to
> make that easier I suppose.

Early on, the Gtk# generator was producing CharSet parameters in the
DllImport attrs, but was probably doing it wrong (CharSet.Ansi).  

We've recently been cleaning up some long-lived issues with string
marshaling from the native side, although it sounds like the choice of
Marshal.PtrToStringAnsi for Gtk+ strings was a dubious one. 

Dietmar's recently announced custom marshaler availability.  That may be
the best current alternative for a solution for utf8 strings, although
it would be nice to get a definitive call from the runtime guys on what
behavior mono wants to expose.  Maybe mono could lobby the ECMA to add
CharSet.Utf8 and implement it in the meantime?  It would be nice to be
able to just generate CharSet=CharSet.Utf8 in DllImports.

Mike