[squeak-dev] WideString fromPacked: 'TEXT' asPacked - > DNU and Boum

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] WideString fromPacked: 'TEXT' asPacked - > DNU and Boum

stephane ducasse
in 3.9, 3.10 and Pharo.

Stef


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: WideString fromPacked: 'TEXT' asPacked - > DNU and Boum

Nicolas Cellier-3
stephane ducasse a écrit :
> in 3.9, 3.10 and Pharo.
>
> Stef
>
>
>


Stef, are you tracking candidates for #deprecated or just nonsense
self-test comments?

That said, the problem is not with #fromPacked:/#asPacked per se.

Printing (Character value: 16r12345678) can freeze your image as well.

This is because the so called #leadingChar does not corresponds to a
known EncodedCharSet. This triggers a low level
CharacterScanner/DisplayScanner method failure, and that is never a good
thing to do to your image, because the same error does repeat again and
again (I did not determine if caused by World cycle or Debugger printing
some information or ???).

An easy workaround is to allocate Unicode in place of nil in:
EncodedCharSet class>>initialize
"
        self initialize
"
        self allSubclassesDo: [:each | each initialize].

        EncodedCharSets _ Array new: 256 withAll: Unicode.
        snip...

A better feature would be to prevent recursive Debugger invocations...
But that is a little harder I guess.

Nicolas


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: WideString fromPacked: 'TEXT' asPacked - > DNU and Boum

Yoshiki Ohshima-2
> An easy workaround is to allocate Unicode in place of nil in:
> EncodedCharSet class>>initialize
> "
> self initialize
> "
> self allSubclassesDo: [:each | each initialize].
>
> EncodedCharSets _ Array new: 256 withAll: Unicode.
> snip...
>
> A better feature would be to prevent recursive Debugger invocations...
> But that is a little harder I guess.

  And for a system like Pharo that really doesn't have to carry the
big burden from the previous version, Unicode can be the first entry,
and the other language environments can be reordered to pack the
entries in EncodedCharSets.  (Along with the all name changes and
cleanup.)

-- Yoshiki

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: WideString fromPacked: 'TEXT' asPacked - > DNU and Boum

stephane ducasse
Thanks Yoshiki

It seems so easy when you say it :)
I'm learning the hard way encodings :)
I want to go over the OLPC changes (but I have to understand a bit  
more than the basis)
But I'm learning something new so this is cool.

So first question:
        can I freely put
        EncodedCharSers at: 0+1 put: Unicode?

What the order in EncodedCharSets represents? Is it the way the  
encoding by default are looked up?

Thanks master

LukeStef trying to fly with his saber lazer

On Sep 24, 2008, at 7:31 AM, Yoshiki Ohshima wrote:

>> An easy workaround is to allocate Unicode in place of nil in:
>> EncodedCharSet class>>initialize
>> "
>> self initialize
>> "
>> self allSubclassesDo: [:each | each initialize].
>>
>> EncodedCharSets _ Array new: 256 withAll: Unicode.
>> snip...
>>
>> A better feature would be to prevent recursive Debugger  
>> invocations...
>> But that is a little harder I guess.
>
>  And for a system like Pharo that really doesn't have to carry the
> big burden from the previous version, Unicode can be the first entry,
> and the other language environments can be reordered to pack the
> entries in EncodedCharSets.  (Along with the all name changes and
> cleanup.)
>
> -- Yoshiki
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: WideString fromPacked: 'TEXT' asPacked - > DNU and Boum

stephane ducasse
In reply to this post by Yoshiki Ohshima-2
Do you mean that we could get rid of the leadChar too? :)

Stef
On Sep 24, 2008, at 7:31 AM, Yoshiki Ohshima wrote:

>> An easy workaround is to allocate Unicode in place of nil in:
>> EncodedCharSet class>>initialize
>> "
>> self initialize
>> "
>> self allSubclassesDo: [:each | each initialize].
>>
>> EncodedCharSets _ Array new: 256 withAll: Unicode.
>> snip...
>>
>> A better feature would be to prevent recursive Debugger  
>> invocations...
>> But that is a little harder I guess.
>
>  And for a system like Pharo that really doesn't have to carry the
> big burden from the previous version, Unicode can be the first entry,
> and the other language environments can be reordered to pack the
> entries in EncodedCharSets.  (Along with the all name changes and
> cleanup.)
>
> -- Yoshiki
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: WideString fromPacked: 'TEXT' asPacked - > DNU and Boum

Yoshiki Ohshima-2
In reply to this post by stephane ducasse
At Sat, 27 Sep 2008 08:30:22 +0200,
stephane ducasse wrote:

>
> Thanks Yoshiki
>
> It seems so easy when you say it :)
> I'm learning the hard way encodings :)
> I want to go over the OLPC changes (but I have to understand a bit  
> more than the basis)
> But I'm learning something new so this is cool.
>
> So first question:
> can I freely put
> EncodedCharSers at: 0+1 put: Unicode?

  That probably wouldn't work.  I thought about a variation where the
first entries looks like:

EncodedCharSers at: 0+1 put: Latin1Environment.
EncodedCharSers at: 1+1 put: Unicode.

and unless you really need stick with 1 or 0.

> What the order in EncodedCharSets represents? Is it the way the  
> encoding by default are looked up?

  The order doesn't matter.

> Do you mean that we could get rid of the leadChar too? :)

  Well, I wouldn't if you have other mechanism in place.

-- Yoshiki