[squeak-dev] Several versions of Multilingual in inbox could do with review

Rein, Patrick Patrick.Rein at hpi.de
Thu Aug 31 16:25:23 UTC 2017


​Hi Eliot,

I finally got around looking at the fixes and some of the changes in the inbox. Before I commit my merge of your fix and the adjustments could you tell me which test cases failed for you? In a vanilla trunk I can see no failures of the UTF16 tests (at least not until my recent commit of new tests). 

The nil check was actually missing from the swapLatin1EncodingByteOrder method. However, the reverse logic is just fine as the cached encoding for a latin1 character is stored as a string of ASCII characters. Reversing the string has exactly the effect you described. 

Bests
Patrick


From: Eliot Miranda <eliot.miranda at gmail.com>
Sent: Thursday, July 13, 2017 03:27
To: Rein, Patrick; Levente Uzonyi
Cc: The general-purpose Squeak developers list; Henrik Johansen
Subject: Several versions of Multilingual in inbox could do with review
  

Hi Patrick, Hi Levente, Hi ALl,

    I just did a simple fix for two test failures in UTF16TextConverterTest and committed to inbox only to discover that there are several other versions waiting review.  In particular Monty has submitted a substantial change.  Let me ask that those people  who understand the txt converter framework have a look at these proposals.

Another observation is that there are a couple of methods (UTF16TextConverter UTF32TextConverter) that do this:

swapLatin1EncodingByteOrder
latin1Encodings := latin1Encodings collect: [:each | 
each ifNotNil: [each reverse]]

but reverse (quite rightly) isn't implemented in Squeak.  It's meaningless.  One needs to specify a byte size and reverse for that byte size, e.g.  1 reversed in UTF16TextConverter would be 256, but in UTF32TextConverter would be 16777216, right?

But since the latin1Encodings in both  UTF16TextConverter UTF32TextConverter are (rightly) all nil these could just as well be implemented as ^self.

_,,,^..^,,,_
best, Eliot         


More information about the Squeak-dev mailing list