[etoys-dev] Updated: (SQ-554) Etoys does not work with Chinese input

Bert Freudenberg bert at freudenbergs.de
Fri Oct 1 09:15:48 EDT 2010

On 01.10.2010, at 14:09, K. K. Subramaniam wrote:

> On Friday 01 Oct 2010 3:26:39 pm Bert Freudenberg wrote:
>> asciiValue is misnamed, it is actually the raw value of the character
>> (including the language tag), not limited to ASCII.
> That may be the intention but there are many senders of asciiValue that assume 
> ASCII encoding.
> A better idea would be to introduce two methods 'value' to return raw value 
> (i.e. lang and code) and asAscii to return value converted to ASCII. Retain 
> asciiValue only for the case where value < 256 and raise an exception if this 
> is violated. This should help catch all assumptions about char codes in the 
> image (including in comments. see KeyboardEvent).
> Would you like a changeset for this?
> Subbu

No, I don't think that's a good idea. There is already #charCode and #asUnicode and #asInteger. Overriding #value is bad.

Senders should be fixed to use the correct one. Besides, ASCII is only a 7 bit code anyway so should raise an error if > 127, in the strictest sense. I'd just leave it like it is for now. So any sender of #asciiValue should be removed and replaced with the appropriate method call.

This needs to be fixed it in Squeak, too. When we port Etoys to the squeak.org version, we could pick it up from there.

- Bert -

More information about the etoys-dev mailing list