[Seaside] Encoding problem

Sven Van Caekenberghe sven at stfx.eu
Tue May 20 21:15:29 UTC 2014


The XML encoder is not needed to produce the bug:

| stream |
stream := GRPharoUtf8CodecStream on: String new writeStream converter: UTF8TextConverter new.
stream greaseNext: 1 putAll: '->ë' startingAt: 1.
stream contents

is empty but should be '-'.

The error is in 

GRPharoUtf8CodecStream>>#greaseNext:putAllFast:startingAt:

the first escape clause in the whileFalse computes a wrong first argument to #greaseNext:putAllFast:startingAt:

however, it is a bit hard to say what the correct one should be, I will try with

startIndex + anInteger - lastIndex

I hope there are enough tests.

Similar code is in ZnUtf8Encoder>>#next:putAllByteString:startingAt:toStream: but the loop is structured differently - it took me a while to get that one working ;-)

On 20 May 2014, at 22:37, Johan Brichau <johan at inceptive.be> wrote:

> Thanks for reporting, I created an issue for it: https://code.google.com/p/seaside/issues/detail?id=792
> 
> There is something going wrong in the WAPharoXmlEncoder in combination with a GRPharoUtf8EncodedStream:
> 
> |encoder stream |
> stream := GRPharoUtf8CodecStream on: (WriteStream on: String new) converter: UTF8TextConverter new.
> encoder := WAPharoXmlEncoder on: stream.
> encoder nextPutAllFast: '->ë'.
> stream contents
> 
> The above works correctly if the stream is a normal WriteStream
> 
> Getting too late now to dive into it... 
> 
> Johan
> 
> On 20 May 2014, at 19:36, Sven Van Caekenberghe <sven at stfx.eu> wrote:
> 
>> 
>> On 20 May 2014, at 17:19, Paul DeBruicker <pdebruic at gmail.com> wrote:
>> 
>>> On Pharo 1.4, with Seaside 3.1, there is no error.
>>> 
>>> I have not tried with Pier loaded.  Should I?
>> 
>> No, it happens without Pier being loaded.
>> 
>>> 
>>> Johan Brichau-2 wrote
>>>> What version of Seaside are you guys running?
>>>> 
>>>> On 20 May 2014, at 13:19, Sven Van Caekenberghe &lt;
>>> 
>>>> sven@
>>> 
>>>> &gt; wrote:
>>>> 
>>>>> 
>>>>> On 20 May 2014, at 12:47, Stephan Eggermont &lt;
>>> 
>>>> stephan@
>>> 
>>>> &gt; wrote:
>>>>> 
>>>>>> We have an issue in default Pier with rendering/encoding.
>>>>>> Did I miss setting encoding somewhere?
>>>>>> 
>>>>>> If we enter in WAEncodingFunctionalTest the following three characters:
>>>>>> ->ë
>>>>>> the text input field removes the -.
>>>>> 
>>>>> I can confirm the problem. This is really weird.
>>>>> 
>>>>> Apparently you need a non-ascii character preceded by an xml-unsafe one:
>>>>> 
>>>>> abc
>>>>>>>>> 
>>>> aaa&ç
>>>>> 
>>>>> And when the characters are printed one by one wrapped in a span they all
>>>>> show !
>>>>> 
>>>>>> We noticed because the text area used to edit pier documents
>>>>>> became unusable.
>>>>>> 
>>>>>> Stephan
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> seaside mailing list
>>>>>> 
>>> 
>>>> seaside at .squeakfoundation
>>> 
>>>>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>>> 
>>>>> _______________________________________________
>>>>> seaside mailing list
>>>>> 
>>> 
>>>> seaside at .squeakfoundation
>>> 
>>>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>> 
>>>> _______________________________________________
>>>> seaside mailing list
>>> 
>>>> seaside at .squeakfoundation
>>> 
>>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context: http://forum.world.st/Encoding-problem-tp4759665p4759711.html
>>> Sent from the Seaside General mailing list archive at Nabble.com.
>>> _______________________________________________
>>> seaside mailing list
>>> seaside at lists.squeakfoundation.org
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>> 
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list