diff --git a/examples/async-rest/async-rest-jar/src/main/resources/META-INF/web-fragment.xml b/examples/async-rest/async-rest-jar/src/main/resources/META-INF/web-fragment.xml index 559eeafb457..db2b21bebc2 100644 --- a/examples/async-rest/async-rest-jar/src/main/resources/META-INF/web-fragment.xml +++ b/examples/async-rest/async-rest-jar/src/main/resources/META-INF/web-fragment.xml @@ -1,4 +1,4 @@ - + + diff --git a/jetty-deploy/src/test/resources/webapps/foo.xml b/jetty-deploy/src/test/resources/webapps/foo.xml index adf1ac26488..e7c6e9daed0 100644 --- a/jetty-deploy/src/test/resources/webapps/foo.xml +++ b/jetty-deploy/src/test/resources/webapps/foo.xml @@ -1,4 +1,4 @@ - + /foo diff --git a/jetty-distribution/src/main/resources/demo-base/webapps/example-moved.xml b/jetty-distribution/src/main/resources/demo-base/webapps/example-moved.xml index 4b176a44671..53d6bfd3e7f 100644 --- a/jetty-distribution/src/main/resources/demo-base/webapps/example-moved.xml +++ b/jetty-distribution/src/main/resources/demo-base/webapps/example-moved.xml @@ -1,4 +1,4 @@ - + diff --git a/jetty-osgi/jetty-osgi-httpservice/contexts/httpservice.xml b/jetty-osgi/jetty-osgi-httpservice/contexts/httpservice.xml index 8839eaa5431..6aae6e9bf09 100644 --- a/jetty-osgi/jetty-osgi-httpservice/contexts/httpservice.xml +++ b/jetty-osgi/jetty-osgi-httpservice/contexts/httpservice.xml @@ -1,4 +1,4 @@ - + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/overlay.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/overlay.xml index 9d5eaea4563..11c70acf130 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/overlay.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/overlay.xml @@ -1,4 +1,4 @@ - + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/web-overlay.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/web-overlay.xml index 8499944f90b..6eee674e02c 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/web-overlay.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=blue/WEB-INF/web-overlay.xml @@ -1,4 +1,4 @@ - + + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=green/WEB-INF/web-overlay.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=green/WEB-INF/web-overlay.xml index ddda5385c62..92ed7290d78 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=green/WEB-INF/web-overlay.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=green/WEB-INF/web-overlay.xml @@ -1,4 +1,4 @@ - + + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=red/WEB-INF/web-overlay.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=red/WEB-INF/web-overlay.xml index 40927895b9c..c8d9dcb0a64 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=red/WEB-INF/web-overlay.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/instances/myfoo=red/WEB-INF/web-overlay.xml @@ -1,4 +1,4 @@ - + + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/nodes/nodeA/WEB-INF/web-overlay.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/nodes/nodeA/WEB-INF/web-overlay.xml index 27c9960ab99..e9f509aaf89 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/nodes/nodeA/WEB-INF/web-overlay.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/nodes/nodeA/WEB-INF/web-overlay.xml @@ -1,4 +1,4 @@ - + + + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/template.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/template.xml index ec8d822e962..3104fcad938 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/template.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/template.xml @@ -1,4 +1,4 @@ - + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/web-default.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/web-default.xml index 6a116536993..22f82f4af71 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/web-default.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/web-default.xml @@ -1,4 +1,4 @@ - + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/web-overlay.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/web-overlay.xml index c03f435a740..a554231f4ff 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/web-overlay.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/templates/myfoo=foo/WEB-INF/web-overlay.xml @@ -1,4 +1,4 @@ - + + diff --git a/jetty-overlay-deployer/src/test/resources/home/overlays/webapps/foo/WEB-INF/web.xml b/jetty-overlay-deployer/src/test/resources/home/overlays/webapps/foo/WEB-INF/web.xml index 5be798c0b25..b804a9d1b3f 100644 --- a/jetty-overlay-deployer/src/test/resources/home/overlays/webapps/foo/WEB-INF/web.xml +++ b/jetty-overlay-deployer/src/test/resources/home/overlays/webapps/foo/WEB-INF/web.xml @@ -1,4 +1,4 @@ - + + + + + \n"); + writer.write("\n"); writer.write("Error "); writer.write(Integer.toString(code)); @@ -213,7 +212,7 @@ public class ErrorHandler extends AbstractHandler if (reason==null) reason=HttpStatus.getMessage(status); fields.put(HttpHeader.CONTENT_TYPE,MimeTypes.Type.TEXT_HTML_8859_1.asString()); - return BufferUtil.toBuffer("<h1>Bad Message "+status+"</h1><pre>reason: "+reason+"</pre>"); + return BufferUtil.toBuffer("<h1>Bad Message " + status + "</h1><pre>reason: " + reason + "</pre>"); } /* ------------------------------------------------------------ */ diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorCloseTestBase.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorCloseTestBase.java index a8046d62b9c..bc66f9adaed 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorCloseTestBase.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorCloseTestBase.java @@ -26,6 +26,7 @@ import java.io.InputStreamReader; import java.io.OutputStream; import java.net.Socket; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -155,7 +156,7 @@ public abstract class ConnectorCloseTestBase extends HttpServerTestFixture "content-type: text/plain; charset=utf-8\r\n"+ "content-length: "+bytes.length+"\r\n"+ "\r\n" - ).getBytes("iso-8859-1")); + ).getBytes(StandardCharsets.ISO_8859_1)); int len = bytes.length; int offset = 0; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java index b4849bc258b..8a33e655a62 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java @@ -58,13 +58,14 @@ import org.eclipse.jetty.util.log.StdErrLog; import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Test; + /** * */ public abstract class HttpServerTestBase extends HttpServerTestFixture { private static final String REQUEST1_HEADER = "POST / HTTP/1.0\n" + "Host: localhost\n" + "Content-Type: text/xml; charset=utf-8\n" + "Connection: close\n" + "Content-Length: "; - private static final String REQUEST1_CONTENT = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + private static final String REQUEST1_CONTENT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<nimbus xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xsi:noNamespaceSchemaLocation=\"nimbus.xsd\" version=\"1.0\">\n" + "</nimbus>"; private static final String REQUEST1 = REQUEST1_HEADER + REQUEST1_CONTENT.getBytes().length + "\n\n" + REQUEST1_CONTENT; @@ -82,7 +83,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture "Content-Type: text/xml; charset=ISO-8859-1\n" + "Content-Length: "; protected static final String REQUEST2_CONTENT = - "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<nimbus xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xsi:noNamespaceSchemaLocation=\"nimbus.xsd\" version=\"1.0\">\n" + " <request requestId=\"1\">\n" + @@ -94,7 +95,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture protected static final String REQUEST2 = REQUEST2_HEADER + REQUEST2_CONTENT.getBytes().length + "\n\n" + REQUEST2_CONTENT; protected static final String RESPONSE2_CONTENT = - "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<nimbus xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xsi:noNamespaceSchemaLocation=\"nimbus.xsd\" version=\"1.0\">\n" + " <request requestId=\"1\">\n" + @@ -144,7 +145,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture { client.setSoTimeout(10000); ((StdErrLog)Log.getLogger(HttpConnection.class)).setHideStacks(true); - ((StdErrLog)Log.getLogger(HttpConnection.class)).info("expect request is too large, then ISE extra data ..."); + ((StdErrLog) Log.getLogger(HttpConnection.class)).info("expect request is too large, then ISE extra data ..."); OutputStream os = client.getOutputStream(); byte[] buffer = new byte[64 * 1024]; @@ -926,7 +927,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture "host: " + _serverURI.getHost() + ":" + _serverURI.getPort() + "\r\n" + "content-type: text/plain; charset=utf-8\r\n" + "content-length: 10\r\n" + - "\r\n").getBytes("iso-8859-1")); + "\r\n").getBytes(StandardCharsets.ISO_8859_1)); os.write(( "123456789\n" @@ -938,7 +939,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture "content-type: text/plain; charset=utf-8\r\n" + "content-length: 10\r\n" + "\r\n" - ).getBytes("iso-8859-1")); + ).getBytes(StandardCharsets.ISO_8859_1)); os.write(( "abcdefghZ\n" @@ -953,7 +954,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture "content-length: " + contentB.length + "\r\n" + "connection: close\r\n" + "\r\n" - ).getBytes("iso-8859-1")); + ).getBytes(StandardCharsets.ISO_8859_1)); os.write(contentB); os.flush(); @@ -1028,7 +1029,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture "\015\012" + "abcdefghi\n" - ).getBytes("iso-8859-1")); + ).getBytes(StandardCharsets.ISO_8859_1)); String in = IO.toString(is); @@ -1053,7 +1054,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture "host: " + _serverURI.getHost() + ":" + _serverURI.getPort() + "\r\n" + "content-type: text/plain; charset=utf-8\r\n" + "content-length: 10\r\n" + - "\r\n").getBytes("iso-8859-1")); + "\r\n").getBytes(StandardCharsets.ISO_8859_1)); os.write(( "123456789\n" @@ -1065,14 +1066,14 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture "content-type: text/plain; charset=utf-8\r\n" + "content-length: 10\r\n" + "\r\n" - ).getBytes("iso-8859-1")); + ).getBytes(StandardCharsets.ISO_8859_1)); os.write(( "abcdefghi\n" - ).getBytes("utf-8")); + ).getBytes(StandardCharsets.UTF_8)); String content = "Wibble"; - byte[] contentB = content.getBytes("utf-16"); + byte[] contentB = content.getBytes(StandardCharsets.UTF_16); os.write(( "POST /echo?charset=utf-8 HTTP/1.1\r\n" + "host: " + _serverURI.getHost() + ":" + _serverURI.getPort() + "\r\n" + @@ -1080,7 +1081,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture "content-length: " + contentB.length + "\r\n" + "connection: close\r\n" + "\r\n" - ).getBytes("iso-8859-1")); + ).getBytes(StandardCharsets.ISO_8859_1)); os.write(contentB); os.flush(); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java index 3bc388b387c..8e76958ecd4 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestFixture.java @@ -31,6 +31,7 @@ import javax.net.ssl.SSLSession; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.nio.charset.StandardCharsets; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.HandlerWrapper; @@ -42,7 +43,7 @@ import org.junit.Before; public class HttpServerTestFixture { // Useful constants protected static final long PAUSE=10L; - protected static final int LOOPS=PropertyFlag.isEnabled("test.stress")?250:50; + protected static final int LOOPS= PropertyFlag.isEnabled("test.stress")?250:50; protected Server _server; protected URI _serverURI; @@ -168,7 +169,7 @@ public class HttpServerTestFixture response.setStatus(200); InputStream in = request.getInputStream(); - String input=IO.toString(in); + String input= IO.toString(in); String tmp = request.getParameter("writes"); int writes=Integer.parseInt(tmp==null?"10":tmp); @@ -185,7 +186,7 @@ public class HttpServerTestFixture response.setContentType("text/plain"); if (encoding==null) { - byte[] bytes=chunk.getBytes("ISO-8859-1"); + byte[] bytes=chunk.getBytes(StandardCharsets.ISO_8859_1); OutputStream out=response.getOutputStream(); for (int i=0;i<writes;i++) { diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java index f8aa40fcd7a..29db142e7dd 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SSLEngineTest.java @@ -69,14 +69,14 @@ public class SSLEngineTest { // Useful constants private static final String HELLO_WORLD="Hello world. The quick brown fox jumped over the lazy dog. How now brown cow. The rain in spain falls mainly on the plain.\n"; - private static final String JETTY_VERSION=Server.getVersion(); + private static final String JETTY_VERSION= Server.getVersion(); private static final String PROTOCOL_VERSION="2.0"; /** The request. */ private static final String REQUEST0_HEADER="POST /r0 HTTP/1.1\n"+"Host: localhost\n"+"Content-Type: text/xml\n"+"Content-Length: "; private static final String REQUEST1_HEADER="POST /r1 HTTP/1.1\n"+"Host: localhost\n"+"Content-Type: text/xml\n"+"Connection: close\n"+"Content-Length: "; private static final String REQUEST_CONTENT= - "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"+ + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+ "<requests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"+ " xsi:noNamespaceSchemaLocation=\"commander.xsd\" version=\""+PROTOCOL_VERSION+"\">\n"+ "</requests>"; @@ -145,7 +145,7 @@ public class SSLEngineTest String response = IO.toString(client.getInputStream()); - assertThat(response,Matchers.containsString("200 OK")); + assertThat(response, Matchers.containsString("200 OK")); assertThat(response,Matchers.containsString(HELLO_WORLD)); } diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java index 2d887b1e0b8..6a1257ea01a 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletIOTest.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.Socket; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -172,7 +173,7 @@ public class AsyncServletIOTest { socket.setSoTimeout(1000000); OutputStream out = socket.getOutputStream(); - out.write(request.toString().getBytes("ISO-8859-1")); + out.write(request.toString().getBytes(StandardCharsets.ISO_8859_1)); BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()),102400); @@ -207,7 +208,7 @@ public class AsyncServletIOTest public synchronized List<String> process(String content,int... writes) throws Exception { - return process(content.getBytes("ISO-8859-1"),writes); + return process(content.getBytes(StandardCharsets.ISO_8859_1),writes); } public synchronized List<String> process(int... writes) throws Exception @@ -242,7 +243,7 @@ public class AsyncServletIOTest { socket.setSoTimeout(1000000); OutputStream out = socket.getOutputStream(); - out.write(request.toString().getBytes("ISO-8859-1")); + out.write(request.toString().getBytes(StandardCharsets.ISO_8859_1)); if (content!=null && content.length>0) { diff --git a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletTest.java b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletTest.java index decf5712862..b186d7c6052 100644 --- a/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletTest.java +++ b/jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncServletTest.java @@ -99,7 +99,7 @@ public class AsyncServletTest public void tearDown() throws Exception { assertEquals(_expectedLogs,_log.size()); - Assert.assertThat(_log.get(0),Matchers.containsString(_expectedCode)); + Assert.assertThat(_log.get(0), Matchers.containsString(_expectedCode)); _server.stop(); } @@ -379,12 +379,12 @@ public class AsyncServletTest try (Socket socket = new Socket("localhost",_port)) { socket.setSoTimeout(10000); - socket.getOutputStream().write(header.getBytes("ISO-8859-1")); + socket.getOutputStream().write(header.getBytes(StandardCharsets.ISO_8859_1)); Thread.sleep(500); - socket.getOutputStream().write(body.getBytes("ISO-8859-1"),0,2); + socket.getOutputStream().write(body.getBytes(StandardCharsets.ISO_8859_1),0,2); Thread.sleep(500); - socket.getOutputStream().write(body.getBytes("ISO-8859-1"),2,8); - socket.getOutputStream().write(close.getBytes("ISO-8859-1")); + socket.getOutputStream().write(body.getBytes(StandardCharsets.ISO_8859_1),2,8); + socket.getOutputStream().write(close.getBytes(StandardCharsets.ISO_8859_1)); String response = IO.toString(socket.getInputStream()); assertEquals("HTTP/1.1 200 OK",response.substring(0,15)); @@ -434,7 +434,7 @@ public class AsyncServletTest protected void assertContains(String content,String response) { - Assert.assertThat(response,Matchers.containsString(content)); + Assert.assertThat(response, Matchers.containsString(content)); } protected void assertNotContains(String content,String response) diff --git a/jetty-webapp/src/main/config/etc/webdefault.xml b/jetty-webapp/src/main/config/etc/webdefault.xml index 3ee21fdb921..e2ad2a7ef97 100644 --- a/jetty-webapp/src/main/config/etc/webdefault.xml +++ b/jetty-webapp/src/main/config/etc/webdefault.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlAppendable.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlAppendable.java index 5a11c7505cd..4ea400fb1cd 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlAppendable.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlAppendable.java @@ -40,7 +40,7 @@ public class XmlAppendable { _out=out; _indent=indent; - _out.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"); + _out.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); } public XmlAppendable open(String tag, Map<String,String> attributes) throws IOException diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java index 4d8d1ad151b..10b6e25badd 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java @@ -95,7 +95,7 @@ public class XmlConfiguration private synchronized static XmlParser initParser() { XmlParser parser = new XmlParser(); - URL config60 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_6_0.dtd"); + URL config60 = Loader.getResource(XmlConfiguration.class, "org/eclipse/jetty/xml/configure_6_0.dtd"); URL config76 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_6.dtd"); URL config90 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_9_0.dtd"); parser.redirectEntity("configure.dtd",config90); @@ -150,7 +150,7 @@ public class XmlConfiguration */ public XmlConfiguration(String configuration) throws SAXException, IOException { - configuration = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<!DOCTYPE Configure PUBLIC \"-//Jetty//Configure//EN\" \"http://eclipse.org/jetty/configure.dtd\">" + configuration = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE Configure PUBLIC \"-//Jetty//Configure//EN\" \"http://eclipse.org/jetty/configure.dtd\">" + configuration; InputSource source = new InputSource(new StringReader(configuration)); synchronized (__parser) diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlAppendableTest.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlAppendableTest.java index dd8f3c355eb..d1f6867584f 100644 --- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlAppendableTest.java +++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlAppendableTest.java @@ -49,6 +49,6 @@ public class XmlAppendableTest out.close(); String s = b.toString(); - Assert.assertEquals("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<test>\n <tag/>\n <tag quotes=\"'"\" name=\"attr value\" noval=\"\"/>\n <tag quotes=\"'"\" name=\"attr value\" noval=\"\">content</tag>\n <level1>\n <tag>content</tag>\n <tag>content</tag>\n </level1>\n <level1 quotes=\"'"\" name=\"attr value\" noval=\"\">\n <level2>\n <tag>content</tag>\n <tag>content</tag>\n </level2>\n </level1>\n</test>\n",s); + Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<test>\n <tag/>\n <tag quotes=\"'"\" name=\"attr value\" noval=\"\"/>\n <tag quotes=\"'"\" name=\"attr value\" noval=\"\">content</tag>\n <level1>\n <tag>content</tag>\n <tag>content</tag>\n </level1>\n <level1 quotes=\"'"\" name=\"attr value\" noval=\"\">\n <level2>\n <tag>content</tag>\n <tag>content</tag>\n </level2>\n </level1>\n</test>\n",s); } } diff --git a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java index 5f9d949bf2d..d4bb45d0565 100644 --- a/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java +++ b/jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java @@ -27,6 +27,7 @@ import static org.junit.Assert.assertTrue; import java.io.ByteArrayInputStream; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; @@ -578,7 +579,7 @@ public class XmlConfigurationTest " <Arg>arg3</Arg>\n" + " </New>" + " </Set>" + - "</Configure>").getBytes("ISO-8859-1"))); + "</Configure>").getBytes(StandardCharsets.ISO_8859_1))); // XmlConfiguration xmlConfiguration = new XmlConfiguration(url); AnnotatedTestConfiguration atc = (AnnotatedTestConfiguration)xmlConfiguration.configure(); @@ -606,7 +607,7 @@ public class XmlConfigurationTest " <Set name=\"third\">arg3</Set> " + " </New>" + " </Set>" + - "</Configure>").getBytes("ISO-8859-1"))); + "</Configure>").getBytes(StandardCharsets.UTF_8))); // XmlConfiguration xmlConfiguration = new XmlConfiguration(url); DefaultTestConfiguration atc = (DefaultTestConfiguration)xmlConfiguration.configure(); diff --git a/jetty-xml/src/test/resources/org/eclipse/jetty/xml/configure.xml b/jetty-xml/src/test/resources/org/eclipse/jetty/xml/configure.xml index 7fcccd23700..46c85718cfe 100644 --- a/jetty-xml/src/test/resources/org/eclipse/jetty/xml/configure.xml +++ b/jetty-xml/src/test/resources/org/eclipse/jetty/xml/configure.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.xml.TestConfiguration"> diff --git a/jetty-xml/src/test/resources/org/eclipse/jetty/xml/mortbay.xml b/jetty-xml/src/test/resources/org/eclipse/jetty/xml/mortbay.xml index 2607bf8a191..e1c18086011 100644 --- a/jetty-xml/src/test/resources/org/eclipse/jetty/xml/mortbay.xml +++ b/jetty-xml/src/test/resources/org/eclipse/jetty/xml/mortbay.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure class="java.lang.Object"> </Configure> diff --git a/tests/test-integration/src/test/resources/webapp-contexts/RFC2616/rfc2616-webapp.xml b/tests/test-integration/src/test/resources/webapp-contexts/RFC2616/rfc2616-webapp.xml index c87489fd758..74d2fe9ae98 100644 --- a/tests/test-integration/src/test/resources/webapp-contexts/RFC2616/rfc2616-webapp.xml +++ b/tests/test-integration/src/test/resources/webapp-contexts/RFC2616/rfc2616-webapp.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Set name="contextPath">/rfc2616-webapp</Set> diff --git a/tests/test-integration/src/test/resources/webdefault.xml b/tests/test-integration/src/test/resources/webdefault.xml index 35a5a9b7a10..d87a7e24e1b 100644 --- a/tests/test-integration/src/test/resources/webdefault.xml +++ b/tests/test-integration/src/test/resources/webdefault.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- ===================================================================== --> <!-- This file contains the default descriptor for web applications. --> diff --git a/tests/test-webapps/test-jaas-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/tests/test-webapps/test-jaas-webapp/src/main/webapp/WEB-INF/jetty-web.xml index c8ce7b4d8b2..e7830c65bcf 100644 --- a/tests/test-webapps/test-jaas-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/tests/test-webapps/test-jaas-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> diff --git a/tests/test-webapps/test-jetty-webapp/src/main/assembly/embedded-jetty-web-for-webbundle.xml b/tests/test-webapps/test-jetty-webapp/src/main/assembly/embedded-jetty-web-for-webbundle.xml index 911b9479ff7..5d223e3cf5a 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/assembly/embedded-jetty-web-for-webbundle.xml +++ b/tests/test-webapps/test-jetty-webapp/src/main/assembly/embedded-jetty-web-for-webbundle.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <!-- ================================================================== diff --git a/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.d/override-web.xml b/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.d/override-web.xml index e7b98aab42d..8a58a83f6a3 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.d/override-web.xml +++ b/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.d/override-web.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" diff --git a/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.xml b/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.xml index c4bdf98e3de..43047f90535 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.xml +++ b/tests/test-webapps/test-jetty-webapp/src/main/config/demo-base/webapps/test.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <!-- ================================================================== diff --git a/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/acme-taglib.tld b/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/acme-taglib.tld index 03adecef5e1..09b70aece57 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/acme-taglib.tld +++ b/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/acme-taglib.tld @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> diff --git a/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/jetty-web.xml index c4a00e9fb50..19fb028dda4 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <!-- diff --git a/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/web.xml b/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/web.xml index 9095a617f4f..a2b37637578 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/web.xml +++ b/tests/test-webapps/test-jetty-webapp/src/main/webapp/WEB-INF/web.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" diff --git a/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-web.xml index f4d04d868cf..fd4831e8b6a 100644 --- a/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> diff --git a/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/web.xml b/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/web.xml index 606db8a5661..10185331275 100644 --- a/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/web.xml +++ b/tests/test-webapps/test-jndi-webapp/src/main/webapp/WEB-INF/web.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" diff --git a/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/jetty-web.xml index e43b1c0dc53..030fd192cf6 100644 --- a/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> diff --git a/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/web.xml b/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/web.xml index 4cdd183862f..5cfa55da11a 100644 --- a/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/web.xml +++ b/tests/test-webapps/test-proxy-webapp/src/main/webapp/WEB-INF/web.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml index 8ce2f62a73f..62b92f994d9 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/web.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/web.xml index f78c0691e18..e81ecc1ab42 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/web.xml +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/webapp/WEB-INF/web.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/web-fragment.xml b/tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/web-fragment.xml index 216efde8c79..e932576d743 100644 --- a/tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/web-fragment.xml +++ b/tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/web-fragment.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> +<?xml version="1.0" encoding="UTF-8"?> <web-fragment xmlns="http://xmlns.jcp.org/xml/ns/javaee"