title: Can't get proper encoding for JExcel/jxl
body: <p>I have a problem of character encoding while using JExcel.
  My app creates an excel document from a template and fills it with with data from a database (filled with current and previous sessions user-input) before sending it to the user.
  In the final document, non-ASCII characters <em>FROM THE TEMPLATE</em> such as <code>é</code>, <code>è</code>, <code>à</code>, or <code>°</code> are not rendered properly (in the generated document, they appear properly in the template) and are instead replaced by <code>�</code> while those from the database are properly encoded.</p>
  
  <p>I use UTF-8 for user input (and output to the viewing layer) as well as database storage.</p>
  
  <p>I use this code in the class that generates the file:</p>
  
  <pre><code>    private void createFile(Arguments...)
              throws IOException, BiffException, RowsExceededException, WriteException
      {
              File XLSFile = new File(MyPath);
              WorkbookSettings XLSSettings = new WorkbookSettings()
              XLSSettings.setEncoding(Constants.TEMPLATE_ENCODING)
              // Constants.java is a class containing only app-wide constants declared as public static final
              Workbook template = Workbook.getWorkbook(
                      new File(Constants.TEMPLATE_PATH));
              WritableWorkbook userDocument =
                      Workbook.createWorkBook(XLSFile,template,XLSSettings);
              template.close();
              WritableSheet sheet = userDocument.getSheet(0);
  
              ...
                      Code that fills my workbook and sheet by creating new Labels and
                      adding them to my WritableSheet with sheet.add(Label)
              ...
  
              userDocument.write();
              userDocument.close();
      }
  </code></pre>
  
  <p><code>Constants.TEMPLATE_ENCODING</code> has been set to <code>"Cp1252"</code> as was suggested in this question: <a href="https://stackoverflow.com/questions/5701743/encoding-problem-in-jexcel">Encoding problem in JExcel</a> but to no avail however.</p>
  
  <p>Trying to change it to <code>"UTF-8"</code> produced no visible change either.</p>
  
  <p>The application works otherwise just fine at every level.
  I figured it might be a problem of setting the proper encoding when opening and copying the template and tried to change this line</p>
  
  <p><code>Workbook template = Workbook.getWorkbook(new File(Constants.TEMPLATE_PATH);</code></p>
  
  <p>to</p>
  
  <p><code>Workbook template = Workbook.getWorkbook(new File(Constants.TEMPLATE_PATH, XLSSettings);</code></p>
  
  <p>but it produces an ArrayOutOfBoundException in <code>java.lang.System.arraycopy</code> propagating from this line <code>userDocument.write();</code> via</p>
  
  <pre><code>    java.lang.ArrayIndexOutOfBoundsException
          java.lang.System.arraycopy(Native Method)
          jxl.biff.StringHelper.getBytes(StringHelper.java:127)
          jxl.write.biff.WriteAccessRecord.&lt;init&gt;(WriteAccessRecord.java:59)
          jxl.write.biff.WritableWorkbookImpl.write(WritableWorkbookImpl.java:726)
          com.mypackage.MyClass.createFile(MyClass.java:337)
  </code></pre>
  
  <p>Anyone ever encountered the problem and know how to fix it ?</p>