title: unicode text file output differs between XE2 and Delphi 2009?
body: <p>When I try the code below there seem to be different output in XE2 compared to D2009.</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
  var Outfile:textfile;
      myByte: Byte;
  
  begin
    assignfile(Outfile,'test_chinese.txt');
    Rewrite(Outfile);
  
    for myByte in TEncoding.UTF8.GetPreamble do write(Outfile, AnsiChar(myByte));
    //This is the UTF-8 BOM
  
    Writeln(Outfile,utf8string('总结'));
    Writeln(Outfile,'°C');
    Closefile(Outfile);
  end;
  </code></pre>
  
  <p>Compiling with XE2 on a Windows 8 PC gives in WordPad</p>
  
  <p>??
   C</p>
  
  <p>txt hex code: EF BB BF 3F 3F 0D 0A B0 43 0D 0A</p>
  
  <p>Compiling with D2009 on a Windows XP PC gives in Wordpad</p>
  
  <p>总结
  °C</p>
  
  <p>txt hex code: EF BB BF E6 80 BB E7 BB 93 0D 0A B0 43 0D 0A</p>
  
  <p>My questions is why it differs and how can I save Chinese characters to a text file using the old text file I/O?</p>
  
  <p>Thanks!</p>