title: Loss of special characters while using javax.xml.transform.Transformer
body: <p>I have following problem - I lose some of special characters when using javax.xml.transform.Transformer. Both xml and xls files are UTF-8 formatted. </p>
  
  <p>I seem to lose some of capital polish characters - Ą,Ł etc during transform and replaced by "�?" characters.</p>
  
  <p>Here is my transforming method:</p>
  
  <pre><code>public static boolean transform(Logger logger, String inXML,String inXSL,String outTXT)  throws Exception
  {  
      try
      {
          TransformerFactory factory = TransformerFactory.newInstance();
          ErrorListener listener = new ErrorListener() 
          {
              @Override
              public void warning(TransformerException exception)
                      throws TransformerException {}
              @Override
              public void fatalError(TransformerException exception)
                      throws TransformerException {}
              @Override
              public void error(TransformerException exception)
                      throws TransformerException {}
          };
          factory.setErrorListener(listener);
          StreamSource xslStream = new StreamSource(inXSL);
          Transformer transformer = factory.newTransformer(xslStream);
          StreamSource in = new StreamSource(inXML); 
          StreamResult out = new StreamResult(outTXT);
          transformer.transform(in,out);
          return true;
      }
      catch(Exception e)
      {
          logger.log("ERROR DURING XSLT TRANSFORM (" + e.getMessage() + ")",2);
          return false;
      }   
  } 
  </code></pre>
  
  <p>Any help will be appreciated!</p>
  
  <p>=====</p>
  
  <p>Using XSL file - <a href="http://crd.gov.pl/xml/schematy/UPO/2008/05/09/UPO.xsl" rel="nofollow">Link</a></p>