From 6b6d7e77c3161e90dcf0ab2254464fe9e1d3c896 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 8 Sep 2009 04:32:47 +0000 Subject: [PATCH] JETTY-1098 Default form encoding is UTF8 git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@825 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../java/org/eclipse/jetty/util/UrlEncoded.java | 14 +++++++------- .../org/eclipse/jetty/util/URLEncodedTest.java | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 1c46a40f741..b9a8ba1698f 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -7,6 +7,7 @@ jetty-7.0.0.RC6-SNAPSHOT + JETTY-1090 resolve potential infinite loop with webdav listener + JETTY-1092 MultiPartFilter can be pushed into infinite loop + JETTY-1093 Request.toString throws exception when size exceeds 4k + + JETTY-1098 Default form encoding is UTF8 + 288514 AbstractConnector does not handle InterruptedExceptions on shutdown + 288466 LocalConnector is not thread safe + 288772 Failure to connect does not set status to EXCEPTED diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java index a7d647c4dec..d9f338a7881 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java @@ -492,17 +492,17 @@ public class UrlEncoded extends MultiMap 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)) + if (charset==null || StringUtil.__UTF8.equalsIgnoreCase(charset)) { decodeUtf8To(in,map,maxLength); return; } + + if (StringUtil.__ISO_8859_1.equals(charset)) + { + decode88591To(in,map,maxLength); + return; + } if (StringUtil.__UTF16.equalsIgnoreCase(charset)) // Should be all 2 byte encodings { diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java index e65cd622e65..2d94430e919 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java @@ -152,7 +152,7 @@ public class URLEncodedTest extends junit.framework.TestCase { String [][] charsets = new String[][] { - {StringUtil.__ISO_8859_1,null}, + {StringUtil.__UTF8,null}, {StringUtil.__ISO_8859_1,StringUtil.__ISO_8859_1}, {StringUtil.__UTF8,StringUtil.__UTF8}, {StringUtil.__UTF16,StringUtil.__UTF16},