title: Characters not displaying properly with Struts2 file download
body: <p>I am using Struts2 file download for downloading a file from AS400 server.The file which i am downloading has CCSID 37(ebcdic) and when it is downloaded to PC it doesnot show anything just junk characters. When i display it on AS400 server its shows fine . Please suggest !
  Help is appreciated!</p>
  
  <p>jsp form :</p>
  
  <pre><code>&lt;%@ page contentType="text/html;charset=UTF-8" %&gt;
  &lt;%@ taglib prefix="s" uri="/struts-tags" %&gt;    
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;File Download&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;s:form action="/execFileDownload"&gt;
  &lt;s:textfield key="serverFiletobeDownload" label="Server File"/&gt;
  &lt;s:submit value="Download"/&gt;
  &lt;/s:form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>struts.xml</p>
  
  <pre><code>&lt;struts&gt;
      &lt;constant name="struts.multipart.maxSize" value="2000000000" /&gt;
      &lt;package name="default"  extends="struts-default"&gt;
      &lt;action name="execFileDownload" class="utils.action.FileDownloadAction"&gt;
              &lt;result name="success" type="stream"&gt;
                  &lt;param name="contentType"&gt;application/octet-stream&lt;/param&gt;
                  &lt;param name="inputName"&gt;inputStream&lt;/param&gt;
                  &lt;param name="contentDisposition"&gt;attachment;filename="${fileName}"&lt;/param&gt;
                  &lt;param name="bufferSize"&gt;4096&lt;/param&gt;
  
              &lt;/result&gt;
      &lt;/action&gt;
  &lt;struts&gt; 
  </code></pre>
  
  <p>Action class:</p>
  
  <pre><code>public class FileDownloadAction extends ActionSupport {
      private static final long serialVersionUID = 1L;
      private InputStream inputStream;
      private long contentLength;
      private String fileName;
      public InputStream getInputStream() {
          return inputStream;
      }
  
      public long getContentLength() {
          return contentLength;
      }
  
      public String getFileName() {
          return fileName;
      }
  
      private String serverFiletobeDownload;
  
      public String getServerFiletobeDownload() {
          return serverFiletobeDownload;
      }
  
      public void setServerFiletobeDownload(String serverFiletobeDownload) {
          this.serverFiletobeDownload = serverFiletobeDownload;
      }
  
      public String execute() throws FileNotFoundException {
          File fileToDownload = new File(serverFiletobeDownload.trim());
          inputStream = new FileInputStream(fileToDownload);
          fileName = fileToDownload.getName();
          contentLength = fileToDownload.length();
          return SUCCESS;
      }
  }
  </code></pre>