title: Exporting xmltype columns to file with diacritical marks in it
body: <p>I'm buidling a export in PL/SQL to export data about customers. The xml is build up in a temporary table and until that point everything seems to work file.</p>
  
  <p>However, when the xmltype columns are written into files, I run into trouble.</p>
  
  <p>When I for instance have a name like 'Böhomer', and I export it to a file, i see a few things happening:</p>
  
  <p>When I open it with Textpad, everything seems fine, and I see the ö letter</p>
  
  <p>When I open it with a XML editor like Oxygen, I see Bhomer</p>
  
  <p>When I read it with Java, I see B�hmer</p>
  
  <p>I Assume the file should be properly readable by all three of these methods and suspect I do something wrong with the encoding of the files (Although the right data is in the file, since I can see it with textpad, I think I will get complaining customers when I send this kind of XML out)</p>
  
  <p>The problem is, I have no idea how to get it right, or even what the right encoding is. The writing of the files is done by UTL_FILE.</p>
  
  <p>Interesting thing to note is that when I open the file with textpad and save it while explicitly selecting UTF-8 encoding, it becomes readable for the oxygen XML editor and java. I tried to make my PL/SQL code save it as UTF-8, using UTL_FILE.FOPEN_NCHAR procedure, but this only gave me errors like  ORA-29298: Character set mismatch.</p>
  
  <p>Any ideas how I could solve this problem?</p>
  
  <p>My database character set is WE8MSWIN1252</p>
  
  <p>Versions in use:
  Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
  PL/SQL Release 11.2.0.2.0 - Production
  CORE    11.2.0.2.0  Production
  TNS for 64-bit Windows: Version 11.2.0.2.0 - Production
  NLSRTL Version 11.2.0.2.0 - Production</p>