title: CXF, XMLStreamWriter and Encoding
body: <p>I have a spring web project that should now be implemented with cxf and web services. </p>
  
  <p>One function is to output an xml file. I am using the XMLStreamWriter for this task. Everything works fine.</p>
  
  <p>BUT when I add some cxf dependencies into my POM-File, the output xml file gets the "IBM1252" encoding. The xml file can not be read afterwards. Exception: "Invalid encoding name IBM1252" is thrown.</p>
  
  <p>I have added following dependencies:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-core&lt;/artifactId&gt;
          &lt;version&gt;${cxf.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-frontend-jaxws&lt;/artifactId&gt;
          &lt;version&gt;${cxf.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-transports-http&lt;/artifactId&gt;
          &lt;version&gt;${cxf.version}&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>I didn't change anything in my code. And I have even tried this: </p>
  
  <pre><code>    XMLStreamWriter writer = facOut.createXMLStreamWriter(fileWriter);
      writer.writeStartDocument("UTF-8", "1.0");
  </code></pre>
  
  <p>I still get the "IBM1252" encoding.</p>
  
  <p>Does anyone have an idea what could be the reason for it?</p>