Jeroen said:
No, it doesn't. Try it yourself in a new ASP.NET project (without other
code or other files to interfere). Make sure this code actually
executes, and nothing else.
Either this is not the code you're using in your actual project or
you're overlooking something.
lol
are do a test ?
ok ok, for you : here a simple code in a new empty website :
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.IO.StreamWriter sw = new
System.IO.StreamWriter(Server.MapPath("./") + "test.xml", false,
System.Text.Encoding.UTF8);
sw.Write("a text");
sw.Close();
}
}
that write a UTF-16 File !!!! not a a UTF-8 !!!!!! take a time to just
look the BOM ! (edit file in a hexa editor)
System.Text.Encoding.UTF8 = BOM = FFFE (UTF-16 not utf-8)
System.Text.Encoding.Unicode = BOM = FFFE (all right)
Ho ! sorry its a bug ! don't cry !!! just test it correctly ! lol