Die Frustration beim Debuggen einer Webapplikation in der Umlaute trotz vermeintlich korrekter Konfiguration vermurkst wurden, trieb mich unlängst in die Innereien von
Jetty einem leichtgewichtigen Java Servlet Container und Webserver. In der aktuellen Release-Version, immerhin bereits Version 6.1.11 (!), lies mich der folgende Code erleichtert aufatmen.
jetty-6.1.11/modules/util/src/main/java/org/mortbay/util/UrlEncoded.java:
405 / -------------------------------------------------------------- /
406 /** Decoded parameters to Map.
407 @param in the stream containing the encoded parameters
408 */
409 public static void decodeTo(InputStream in, MultiMap map, String charset, int maxLength)
410 throws IOException
411 {
412 if (charset==null || StringUtil.__UTF8.equalsIgnoreCase(charset) || StringUtil.__ISO_8859_1.equalsIgnoreCase(charset))
413 {
414 decodeUtf8To(in,map,maxLength);
415 return;
416 }
417
418 if (StringUtil.__UTF16.equalsIgnoreCase(charset)) // Should be all 2 byte encodings
419 {
420 decodeUtf16To(in,map,maxLength);
421 return;
422 }
Danke, keine weiteren Fragen Eurer Ehren! Zum Vergleich die korrigierte Version von
decodeTo in der
aktuellen SVN HEAD Revision:
/ -------------------------------------------------------------- /
/** Decoded parameters to Map.
@param in the stream containing the encoded parameters
*/
public static void decodeTo(InputStream in, MultiMap map, String charset, int maxLength)
throws IOException
{
if (charset==null || StringUtil.__ISO_8859_1.equals(charset))
{
decode88591To(in,map,maxLength);
return;
}
if (StringUtil.__UTF8.equalsIgnoreCase(charset))
{
decodeUtf8To(in,map,maxLength);
return;
}
if (StringUtil.__UTF16.equalsIgnoreCase(charset)) // Should be all 2 byte encodings
{
decodeUtf16To(in,map,maxLength);
return;
}