@Test public void parseImpliedUtf8() throws Exception { // utf8 encoded form-data without explicit content-type encoding String text = "-----1234\r\n" + "Content-Disposition: form-data; name=\"utf8Html\"\r\n" + "\r\n" + "Ths s the cotet of the fle\n" + "\r\n" + "-----1234--\r\n"; byte[] bytes = text.getBytes("UTF-8"); HttpServletRequest request = new MockHttpServletRequest(bytes, Constants.CONTENT_TYPE); DiskFileItemFactory fileItemFactory = new DiskFileItemFactory(); fileItemFactory.setDefaultCharset("UTF-8"); ServletFileUpload upload = new ServletFileUpload(fileItemFactory); List<FileItem> fileItems = upload.parseRequest(request); FileItem fileItem = fileItems.get(0); assertTrue(fileItem.getString(), fileItem.getString().contains("cotet")); } }