<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 10:13 AM, Cantor, Scott <span dir="ltr"><<a href="mailto:cantor.2@osu.edu" target="_blank">cantor.2@osu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">> It seems to me, its more like Tomcat is following the spec and its having this<br>
> unpleasant side effect in a certain Shibboleth use case.<br>
<br>
</span>The spec itself is broken, I would say. It can't assume an encoding given that the client can use any.<br>
<br></blockquote><div><br></div><div>Do you mean the W3C spec?  I can't comment.  Those folks are waaaay above my pay grade.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
In any case, I thought the usual fix for this was to add the encoding to the AJP connector. People have certainly said that that works.<br></blockquote><div><br></div><div><br></div><div>Yes.  The common solution is to specify one or both of the following in <Connector> in server.xml:<br><br> <span style="background-color:rgb(250,251,255);color:rgb(0,0,0);font-family:consolas,monospace;font-size:14px">URIEncoding="UTF-8"</span></div><div><span style="color:rgb(0,0,0);font-family:consolas,monospace;font-size:14px;background-color:rgb(238,239,255)">useBodyEncodingForURI="true"<br></span><span style="background-color:rgb(250,251,255);color:rgb(0,0,0);font-family:consolas,monospace;font-size:14px"><br>Unfortunately that has no impact on my problem.<br><br>I suspect its because my data, for whatever reason, is NOT coming to me % encoded.  mod_jk is putting it into environment variables and the delivering it via AJP in the body of a GET.  <br><br>The data bytes are percolating thru Tomcat correctly (I've verified them) until they get handled by ByteChunk and converted to a String.  </span></div><div><span style="background-color:rgb(250,251,255);color:rgb(0,0,0);font-family:consolas,monospace;font-size:14px"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> String value= request.getHeader("givenName")<wbr>;<br>
> value= new String( value.getBytes("ISO-8859-1"), "UTF-8");<br>
><br>
> In my case I'll have to use request.getAttribute("<wbr>givenName"); because my<br>
> data is delivered via attributes.<br>
<br>
</span>The trick there is running the encoding switch against the raw bytes of the source string, but it doesn't matter what the source string is.<br><div class="gmail-HOEnZb"><div class="gmail-h5"><br></div></div></blockquote><div><br></div><div>Can you please explain that statement?  I don't understand. </div></div><br></div></div>