[squeak-dev] any objections if I make TextConverter>>decodeString: consume unsigned integer arrays (ByteArray et al) also?

Eliot Miranda eliot.miranda at gmail.com
Mon Nov 21 21:30:53 UTC 2022

On Mon, Nov 21, 2022 at 1:05 PM Jakob Reschke <jakres+squeak at gmail.com>

> Hi Eliot,
> My gut feeling tells me: please go right ahead. I find it irritating how
> some ByteStrings are really just bytes with the "wrong" type anyway. That
> you can look at strings of bytes through those two different lenses always
> reminds me of C and that does not feel well. ;-)


> Besides, if you process UTF-16 bytes, why not use DoubleByteArray?

Godo question and I'm not entirely sure, but I think it comes down to
endianness.  Accessing a UTF-16 stream as bytes allows one to support
either endianness. Using DoubleByteArray makes it straight-forward to use
the platform's endianness, and more difficult to use the other endianness.

> Kind regards,
> Jakob
> Am Mo., 21. Nov. 2022 um 21:18 Uhr schrieb Eliot Miranda <
> eliot.miranda at gmail.com>:
>> Hi All,
>>     in porting the ClipboardExtendedPlugin to Windows and starting using
>> it I want to do UTF-16 => string conversion on ByteArray.  The innards of
>> textConverter>>decodeString: et al are specific for characters for no good
>> reason I can see.  If I don't break the tests does anyone object my
>> adding this polymorphism?
>> _,,,^..^,,,_
>> best, Eliot

best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20221121/8f221491/attachment.html>

More information about the Squeak-dev mailing list