Commits

Anonymous committed 97d258a

Fix for WW-414 - uploaded files should now use the right encoding.

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@306573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 43e426d

Comments (0)

Files changed (1)

File src/java/com/opensymphony/webwork/dispatcher/multipart/PellMultiPartRequest.java

 
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.commons.logging.LogFactory;
+
 
 /* ------------------------------------------------------------ */
 
      * default.properties & webwork.properties.
      */
     private static void setEncoding() {
-        //todo: configuration in xwork needs to support non-action level config
-        try {
-            http.utils.multipartrequest.MultipartRequest.setEncoding("utf-8");
-        } catch (UnsupportedEncodingException e) {
-            String message = "Unknown encoding";
-            log.error(message, e);
-        }
-
-        /*
         String encoding = null;
         try {
             //encoding = Configuration.getString("webwork.i18n.encoding");
                 //See javadoc for MultipartRequest.setEncoding()
                 http.utils.multipartrequest.MultipartRequest.setEncoding(encoding);
             }
+            else {
+                http.utils.multipartrequest.MultipartRequest.setEncoding("UTF-8");
+            }
         } catch (IllegalArgumentException e) {
-            LogFactory.getLog(PellMultiPartRequest.class).info("Could not get encoding property 'webwork.i18n.encoding' for file upload.  Using system default");
+            log.info("Could not get encoding property 'webwork.i18n.encoding' for file upload.  Using system default");
         } catch (UnsupportedEncodingException e) {
-            LogFactory.getLog(PellMultiPartRequest.class).info("Encoding " + encoding + " is not a valid encoding.  Please check your webwork.properties file.");
+            log.error("Encoding " + encoding + " is not a valid encoding.  Please check your webwork.properties file.");
         }
-        */
     }
 }