I am working on a fairly simple SSIS package, which reads from DB2 using ODBC Source and taking it to a flat file destination. But I need this file that is generated to be UTF-8 (without BOM) and not ANSI as it is automatically generated by SSIS. The closest thing that has worked for me is the code below, but it converts it to UTF-8 BOM and the client tells me that the file with BOM does not work for him. Is there any way I can make the file UTF-8?
string srcFilename = Dts.Variables["User::FFDestPath"].Value.ToString();
string text = File.ReadAllText(srcFilename);
File.WriteAllText(srcFilename, text, System.Text.Encoding.UTF8);
Encoding utf8WithoutBom = new UTF8Encoding(false);
utf8WithoutBom
to actually create the file though? – stuartdutf8WithoutBom
but you don’t use it? What do you expect it to do? – stuartdFile.WriteAllText(srcFilename, text, utf8WithoutBom)
? – stuartd