[cffi-devel] A question about C and Unicode
Luís Oliveira
luismbo at gmail.com
Wed Mar 23 21:34:28 UTC 2011
On Wed, Mar 23, 2011 at 5:53 PM, nitralime <nitralime at googlemail.com> wrote:
> +------>-| typedef wchar_t ZAB_CHAR; |
> | | typedef wchar_t ZAB_UC; |
> | Unicode |------+------>-| typedef char16_t ZAB_CHAR; |
> +---------+ | | typedef char16_t ZAB_UC; |
> +------>-| typedef unsigned short ZAB_CHAR; |
> | typedef unsigned short ZAB_UC; |
> The question is now: Is it correct (resp. safe)
> to defctype ZAB_UC just as :uint16 and interpret
> it as a UFT-16 code point (with an appropriate endiannness)?
Maybe. Which typedef applies? This might be a job for cffi-grovel.
> How can the types like wchar_t and char_16_t be defined (resp. used) in
> CFFI?
I'm not sure. You'll have to figure out whether those types are
equivalent to (un)signed short on your platform. Again, cffi-grovel
might help.
--
Luís Oliveira
http://r42.eu/~luis/
More information about the cffi-devel
mailing list