<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font face="Georgia">Dave,<br>
      <br>
      No apologies necessary. Let me know if I can be of further
      assistance.<br>
      <br>
      Cheers,<br>
      Bob<br>
      <br>
    </font>
    <div class="moz-cite-prefix">On 1/12/14 9:58 AM, David T. Lewis
      wrote:<br>
    </div>
    <blockquote cite="mid:20140112145830.GA22696@shell.msen.com"
      type="cite">
      <pre wrap="">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), 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:
</pre>
      <blockquote type="cite">
        <pre wrap="">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: $&amp; startingAt: start.
    end == 0
        ifTrue: [end := string size. more := false]
        ifFalse: [end := end - 1].
    eqSignPos := string indexOf: $= startingAt: start.
    (eqSignPos &gt; 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:
</pre>
        <blockquote type="cite">
          <pre wrap="">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&amp;12=&amp;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: $&amp; startingAt: start.
   end == 0
       ifTrue: [end _ string size. more _ false]
       ifFalse: [end _ end - 1].
   eqSignPos _ string indexOf: $= startingAt: start.
   (eqSignPos &gt; 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 ==&gt; 'St???ane'

whereas, if we knew it was not utf-8, then

   'St%E9phane' unescapePercentsWithTextEncoding: nil ==&gt; '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:
</pre>
          <blockquote type="cite">
            <pre wrap="">On Mon, Dec 23, 2013 at 1:43 PM, Bob Arning<a class="moz-txt-link-rfc2396E" href="mailto:arning315@comcast.net">&lt;arning315@comcast.net&gt;</a>  wrote:
</pre>
            <blockquote type="cite">
              <pre wrap=""> 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')
</pre>
            </blockquote>
            <pre wrap="">Interesting, so somebody somewhere along the way converted the input
</pre>
          </blockquote>
          <pre wrap="">&gt;from something (likely utf-8 although the page is iso-8859-1) to
</pre>
          <blockquote type="cite">
            <pre wrap="">Squeak encoding.

Cheers
Philippe
_______________________________________________
seaside mailing list
<a class="moz-txt-link-abbreviated" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>

</pre>
          </blockquote>
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
      </blockquote>
      <pre wrap="">
</pre>
      <blockquote type="cite">
        <pre wrap="">_______________________________________________
seaside mailing list
<a class="moz-txt-link-abbreviated" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
</pre>
      </blockquote>
      <pre wrap="">
_______________________________________________
seaside mailing list
<a class="moz-txt-link-abbreviated" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>

</pre>
    </blockquote>
    <br>
  </body>
</html>