[Box-Admins] [squeak-dev] Re: [Seaside] SqueakSource/Seaside question - has anyone seen this problem before?

Tobias Pape Das.Linux at gmx.de
Sun Jan 12 17:51:32 UTC 2014


On 12.01.2014, at 15:58, David T. Lewis <lewis at mail.msen.com> wrote:

> Bob,
> 
> Thanks again for debugging this problem on squeaksource.com (and apologies
> for not following up on the matter sooner). The updated version of the
> decodeUrlEncodedForm:multipleValues: does indeed resolve the problem that
> we were seeing. Unfortunately, I found another problem related to WideString
> member names, which is that I cannot (in squeaksource.com screens) edit a
> project and add a new developer to that existing project.
> 
> It seems clear (as previously noted) that we really need to update our
> source.squeak.org and squeaksource.com images to use an up to date Seaside.
> I'm not going to attempt that effort (I'm mainly concerned with just keeping
> squeaksource.com operating)

Let me tell you, it takes years ;)

Best
	-Tobiad

> , so in the mean time I think I will just work
> around the problem by converting the WideString member names to ByteString.
> 
> Fortunately there are only two member names that are WideString, and they
> both belong to the same person (CC'ed on this message), so I think that the
> impact is minor.
> 
> Thanks,
> 
> Dave
> 
> On Mon, Dec 23, 2013 at 12:16:46PM -0500, Bob Arning wrote:
>> And I see that's exactly what newer versions of this method do...
>> 
>> decodeUrlEncodedForm: string multipleValues: boolean
>>    | dict key value start end eqSignPos more |
>>    dict := boolean ifTrue: [HttpFormDictionary new] ifFalse: 
>> [Dictionary new].
>>    string isEmptyOrNil ifTrue: [^dict].
>>    more := true.
>>    start := 1.
>>    [end := string indexOf: $& startingAt: start.
>>    end == 0
>>        ifTrue: [end := string size. more := false]
>>        ifFalse: [end := end - 1].
>>    eqSignPos := string indexOf: $= startingAt: start.
>>    (eqSignPos > end or: [eqSignPos == 0])
>>        ifTrue: [key := (key := string copyFrom: start to: end) 
>> unescapePercentsWithTextEncoding: nil.
>>            value := '']
>>        ifFalse: [key := (key := string copyFrom: start to: 
>> eqSignPos-1) unescapePercentsWithTextEncoding: nil.
>>            value := (value := string copyFrom: eqSignPos+1 to: end) 
>> unescapePercentsWithTextEncoding: nil].
>>    self addKey: key value: value toForm: dict multipleValues: boolean.
>>    start := end + 2.
>>    more] whileTrue.
>> 
>>    ^dict
>> 
>> Cheers,
>> Bob
>> 
>> 
>> On 12/23/13 11:04 AM, Bob Arning wrote:
>>> I see how it happens...
>>> 
>>> using Mac, Chrome with 8859-1 encoding as default, I typed
>>> 
>>>   S, t, option-e, e, p, h, a, n, e
>>> 
>>> in the login screen. What arrives back at the server is
>>> 
>>>   '11=St%E9phane&12=&13=Login'
>>> 
>>> wherupon HttpRequest tries to parse this
>>> -----
>>> decodeUrlEncodedForm: string multipleValues: boolean
>>>   | dict key value start end eqSignPos more |
>>>   dict _ boolean ifTrue: [HttpFormDictionary new] ifFalse: 
>>> [Dictionary new].
>>>   string isEmptyOrNil ifTrue: [^dict].
>>>   more _ true.
>>>   start _ 1.
>>>   [end _ string indexOf: $& startingAt: start.
>>>   end == 0
>>>       ifTrue: [end _ string size. more _ false]
>>>       ifFalse: [end _ end - 1].
>>>   eqSignPos _ string indexOf: $= startingAt: start.
>>>   (eqSignPos > end or: [eqSignPos == 0])
>>>       ifTrue: [key _ (key _ string copyFrom: start to: end) 
>>> unescapePercents.
>>>           value _ '']
>>>       ifFalse: [key _ (key _ string copyFrom: start to: eqSignPos-1) 
>>> unescapePercents.
>>>           value _ (value _ string copyFrom: eqSignPos+1 to: end) 
>>> *unescapePercents*].
>>>   self addKey: key value: value toForm: dict multipleValues: boolean.
>>>   start _ end + 2.
>>>   more] whileTrue.
>>> 
>>>   ^dict
>>> -----
>>> and #unescapePercents does
>>> 
>>> self unescapePercentsWithTextEncoding: 'utf-8'
>>> 
>>>   'St%E9phane' unescapePercents ==> 'St???ane'
>>> 
>>> whereas, if we knew it was not utf-8, then
>>> 
>>>   'St%E9phane' unescapePercentsWithTextEncoding: nil ==> 'St??phane'
>>> 
>>> gives the expected answer. I tried to coax my browser to return utf-8, 
>>> but that had no effect, so I'm wondering if this application would be 
>>> better off using
>>> unescapePercentsWithTextEncoding: nil
>>> rather than
>>>   unescapePercents
>>> 
>>> Cheers,
>>> Bob
>>> 
>>> On 12/23/13 8:15 AM, Philippe Marschall wrote:
>>>> On Mon, Dec 23, 2013 at 1:43 PM, Bob Arning<arning315 at comcast.net>  wrote:
>>>>> It is a WideString and
>>>>> 
>>>>> self asArray collect: [ :e | e asciiValue radix: 16] = #('53' '74'
>>>>> '3FC09C28' '61' '6E' '65' '20' '4D' '75' '6E' '69' '6F' '7A')
>>>> Interesting, so somebody somewhere along the way converted the input
>>>> from something (likely utf-8 although the page is iso-8859-1) to
>>>> Squeak encoding.
>>>> 
>>>> Cheers
>>>> Philippe
>>>> _______________________________________________
>>>> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1665 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.squeakfoundation.org/pipermail/box-admins/attachments/20140112/f49af3eb/signature.pgp


More information about the Box-Admins mailing list