-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
From Gerhard:
It seems that the gemstone primitve encodeUsing: is not working
with the WAUrlEncoder table.
The primitive doesn't like nil as entries in the table.
The method table ^table at WATableBaseEncoder must be implemented to be able to run the test.
'asd' encodeUsing: WAUrlEncoder table ..... always returns nil
I don't have a real patch for this. If the table is initialized with strings only, it seems to work.
But then also the nextPut: method at WATableBasedEncoder must be changed.
e.g.
initializeTable
"Initializes the encoding table."
| stream characterLimit |
characterLimit := self maximumCharacterValue.
"character values at zero so we need to add 1"
table := Array new: characterLimit + 1.
stream := WriteStream on: (String new: 6).
0 to: characterLimit do: [ :index |
| character value |
character := Character codePoint: index.
self encode: character on: stream reset.
"Smalltalk indices are one based but character values start at 0"
value := stream contents = (String with: character)
ifTrue: [ (String with: character) ] .... instead of nil
ifFalse: [ stream contents ].
table at: index + 1 put: value ]
Reactions are currently unavailable