Turecko-americká vycházející matematická hvězda Levent Alpöge ze společnosti Anthropic vyvolal pozdvižení oznámením (PDF), že s pomocí superinteligence Claude od Antropicu dokázal vyřešit jeden ze sedmi největších matematických problémů tisíciletí, slavnou Riemannovu hypotézu (prvočísla se mezi čísly objevují zdánlivě nepravidelně, hypotéza tvrdí, že za jejich rozmístěním je určitý řád). Svůj důkaz uvolnil jako open-source
… více »QueryEncoding (je to rozčíření Jetty), RequestCharacterEncoding se u GETu vůbec nebere v úvahu. S následujícíém nastavením mi funguje testLatin2:
import org.mortbay.jetty.Request;
...
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
if (requestEncoding != null)
request.setCharacterEncoding(requestEncoding);
(Request)request).setQueryEncoding("iso-8859-2");
String tmp = request.getParameter("note");
String tmp1 = new String(tmp.getBytes("ISO-8859-1")); // this is correct for request locale cs
String tmp2 = new String(tmp.getBytes("ISO-8859-2"));
String tmp3 = new String(tmp.getBytes("UTF-8"));
response.setContentType("text/html; charset=ISO-8859-2");
Writer w = response.getWriter();
...
decodeQueryTo třídy org.mortbay.jetty.HttpURI, musí tam být
public void decodeQueryTo(MultiMap parameters, String encoding)
throws UnsupportedEncodingException
{
if (_query==_fragment)
return;
if (encoding==null)
encoding=URIUtil.__CHARSET;
if (StringUtil.isUTF8(encoding))
UrlEncoded.decodeUtf8To(_raw,_query+1,_fragment-_query-1,parameters);
else
UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,encoding),parameters,encoding);
}
Tiskni
Sdílej: