Fix upload header encoding used by apache file upload

Apache file upload library (ServletFileUpload) parses the uploaded file
name with default container file encoding if the encoding is not
specified in the request (accept-charset). Recent browsers do not send
accept-charset header when upload is done by submitting the file from a
form element. In this case, if container default file encoding is set to
ISO-8859-1, file names with special characters (umlauts) are corrupted.

Explicitly set ServletFileUpload header encoding to be UTF-8.

Bug 570119: [FileDialog] Size limit exceeded error message is missing if
uploaded file name has special characters

Change-Id: Ib494e60d70243056b3f1d372080ef01d25199fcb
diff --git a/bundles/org.eclipse.rap.fileupload/src/org/eclipse/rap/fileupload/internal/FileUploadProcessor.java b/bundles/org.eclipse.rap.fileupload/src/org/eclipse/rap/fileupload/internal/FileUploadProcessor.java
index 3340c60..07507e2 100644
--- a/bundles/org.eclipse.rap.fileupload/src/org/eclipse/rap/fileupload/internal/FileUploadProcessor.java
+++ b/bundles/org.eclipse.rap.fileupload/src/org/eclipse/rap/fileupload/internal/FileUploadProcessor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2017 EclipseSource and others.
+ * Copyright (c) 2011, 2021 EclipseSource and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -26,8 +26,10 @@
 import org.eclipse.rap.fileupload.FileUploadReceiver;
 import org.eclipse.rap.fileupload.UploadSizeLimitExceededException;
 import org.eclipse.rap.fileupload.UploadTimeLimitExceededException;
+import org.eclipse.rap.rwt.internal.util.HTTP;
 
 
+@SuppressWarnings( "restriction" )
 final class FileUploadProcessor {
 
   private final FileUploadHandler handler;
@@ -88,6 +90,7 @@
     ServletFileUpload upload = new ServletFileUpload();
     upload.setFileSizeMax( handler.getMaxFileSize() );
     upload.setProgressListener( createProgressListener() );
+    upload.setHeaderEncoding( HTTP.CHARSET_UTF_8 );
     return upload;
   }