This bug report is for Squeak 3.8 gamma latest update: #6485
First of all my apologies for the difficult subject title. The matter itself is quite simple.
In MultiCharacter>>asUnicode we read:
asUnicode | table charset v | charset _ EncodedCharSet charsetAt: self leadingChar. " ==> " (charset isKindOf: Unicode class) ifTrue: [^ self charCode]. table _ charset ucsTable. table isNil ifTrue: [^ 16rFFFD]. v _ table at: self charCode + 1. v = -1 ifTrue: [^ 16rFFFD]. ^ v.
EncodedCharSet>>charSetAt: answers a class. Unicode is also a class, to find out whether charset is located in the class tree that starts with Unicode, we have to write:
(charset isKindOf: Unicdoe)
The added 'class' is badly wrong; it takes us into the metaclass hierarchy where the check answers false.
Same for MultiCharacter>>asUnicodeChar.
Greetings, Boris
Boris,
EncodedCharSet>>charSetAt: answers a class. Unicode is also a class,
This is correct.
to find out whether charset is located in the class tree that starts with Unicode, we have to write:
(charset isKindOf: Unicdoe)
The added 'class' is badly wrong; it takes us into the metaclass hierarchy where the check answers false.
Same for MultiCharacter>>asUnicodeChar.
I guess we should add a boolean method to EncodedCharSet's class side, and test the return value. Using #isKindOf: in this kind of (huh?) method doesn't too much sense.
What do you think?
If it is ok, I'll post a fix along this idea.
Greetings,
Thank you, always,
-- Yoshiki
From: "Yoshiki Ohshima" Yoshiki.Ohshima@acm.org
Boris,
EncodedCharSet>>charSetAt: answers a class. Unicode is also a class,
This is correct.
to find out whether charset is located in the class tree that starts with Unicode, we have to write:
(charset isKindOf: Unicdoe)
The added 'class' is badly wrong; it takes us into the metaclass hierarchy where the check answers false.
Same for MultiCharacter>>asUnicodeChar.
I guess we should add a boolean method to EncodedCharSet's class side, and test the return value. Using #isKindOf: in this kind of (huh?) method doesn't too much sense.
What do you think?
I fear that I fail to fully understand what you plan to do. A code snippet would help.
If it is ok, I'll post a fix along this idea.
Greetings,
Thank you, always,
-- Yoshiki
From: "Yoshiki Ohshima" Yoshiki.Ohshima@acm.org To: "The general-purpose Squeak developers list" squeak-dev@lists.squeakfoundation.org Sent: Friday, December 03, 2004 1:21 AM Subject: Re: [BUG][FIX] two methods in MultiCharacter search a class inthe metaclass hierarchy
Boris,
I fear that I fail to fully understand what you plan to do. A code snippet would help.
Something like the attachment.
Now I understand. I tried it and Unicode display works when I add this method to Unicode class:
isCharset
^ false.
Is this in conformance with your view?
Thank you again!
-- Yoshiki
Boris,
Now I understand. I tried it and Unicode display works when I add this method to Unicode class:
isCharset
^ false.
Is this in conformance with your view?
Ah, yes. That is good. Thank you!
-- Yoshiki
Am 03.12.2004 um 12:56 schrieb Boris Gaertner:
From: "Yoshiki Ohshima" Yoshiki.Ohshima@acm.org To: "The general-purpose Squeak developers list" squeak-dev@lists.squeakfoundation.org Sent: Friday, December 03, 2004 1:21 AM Subject: Re: [BUG][FIX] two methods in MultiCharacter search a class inthe metaclass hierarchy
Boris,
I fear that I fail to fully understand what you plan to do. A code snippet would help.
Something like the attachment.
Now I understand. I tried it and Unicode display works when I add this method to Unicode class:
isCharset
^ false.
Is this in conformance with your view?
Please don't forget to add the outcome of this discussion to mantis...
Marcus
From: "Yoshiki Ohshima" Yoshiki.Ohshima@acm.org
Marcus,
Please don't forget to add the outcome of this discussion to mantis...
This attached version should be good for the update stream.
Yes, I agree.
-- Yoshiki
squeak-dev@lists.squeakfoundation.org