[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pnet-developers] String marshalling
From: |
Marc Haisenko |
Subject: |
Re: [Pnet-developers] String marshalling |
Date: |
Fri, 9 Sep 2005 13:47:07 +0200 |
User-agent: |
KMail/1.8.1 |
> > What's an ANSI charset ? That should be ASCII, shouldn't it ? I'd like to
> > change that.
>
> Windows has traditionally used "ANSI" to mean the locale-specific 8-bit
> character set in use by the OS, even those character sets that aren't
> strictly in the ANSI standard (e.g. Shift-JIS for Japanese). In Unix terms,
> it is the multibyte encoding that is processed by mbtowc and friends.
Ah, I understand.
> > Is there any reason at all to not use UTF-8 for all .NET -> C string
> > marshalling ? Why the ANSI (ASCII ?) option ?
>
> Because it is the easiest thing to draw using the XFontSet routines in
> Xlib, which use the locale-specific encoding. By using ANSI for the
> marshalling, the runtime engine takes care of the conversion, rather than
> having XsharpSupport do it.
... and C functions like printf wouldn't work correctly, it occured to me.
But I found the solution: I didn't know I can set the charset in the DllImport
attribute ! This does the job as I now can force UTF-8 marshalling for the
XsharpDrawStringXft function and thus bypass any locale-specific
conversions :-)
> Cheers,
>
> Rhys.
Thanks for explanations. C'ya,
Marc
--
Marc Haisenko
http://darkdust.net
Today is Boomtime, the 33rd day of Bureaucracy in the YOLD 3171
pgpKJpkY5o4vq.pgp
Description: PGP signature