FFI wide-character type?

Ron Teitelbaum Ron at USMedRec.com
Tue Aug 15 02:39:29 UTC 2006


John,

I tried your suggestion to support the Microsoft wide string: 

aStream := MultiByteBinaryOrTextStream on: String new encoding: 'utf-16'.
aStream converter useLittleEndian: true.
aStream nextPutAll: 'abcde'.
^aStream

And it appears to work great except that the implementation of next throws
it all away.  I'm guessing it will work for ms wide strings -> squeak just
fine, but doesn't support squeak -> ms wide strings very well.  I figured
I'd write an MSWideString class to support this properly.  Do you have any
suggestions and/or am I missing something?

To answer your questions not all calls are this form of wideString, there
are some ascii equivalent methods, but the cryptography code has a lot of
ANS.1 formats, so I guess this is their answer.  I haven't run into other
formats of wide string yet on Microsoft's api.  

Ron Teitelbaum



> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak-dev-
> bounces at lists.squeakfoundation.org] On Behalf Of John M McIntosh
> Sent: Friday, August 04, 2006 7:52 PM
> To: The general-purpose Squeak developers list
> Subject: Re: FFI wide-character type?
> 
> Actually the correct question is what the target character set is for
> the conversion since I was under the
> assumption that one wanted UTF-32 as a result.
> 
> So COM is UTF16? Or some special Windows encoding?
> 
> UTF16 can be either Big E or Little E and you can supply a Byte Order
> Mark that helps resolve what it is.
> When building the UTF16 converter you can specify these details.
> 
> On 4-Aug-06, at 2:00 PM, nicolas cellier wrote:
> 
> > Obviously, Squeak WideString have 32 bits characters while Windows
> > (and other
> > OS i presume) have 16bits characters, and yes, OS byte ordering
> > does matter.
> --
> ========================================================================
> ===
> John M. McIntosh <johnmci at smalltalkconsulting.com>
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ========================================================================
> ===
> 
> 





More information about the Squeak-dev mailing list