static void Main(string args[])
{
using (var streamWriter = new StreamWriter("D:\\path\\outputcsv"))
{
using (var csvWriter = new CsvWriter(streamWriter, CultureInfo.InvariantCulture))
`
This is my code to create a file named output file which is giving me a utf-8 file But my company need the output as utf-8 with bom file which I don't know how to create.
I tried this
static void Main(string args[])
{
using (var streamWriter =new
StreamWriter("D:\\path\\outputcsv",false,UTF8Encoding(false))
{
using (var csvWriter = new CsvWriter(streamWriter, CultureInfo.InvariantCulture))
but not working... Thanks in advance:)
I've edited the code like this
using (var streamWriter = new StreamWriter("D:\path\Output.csv", true,UTF8Encoding(true))) {
But still, it gives me the errors 1)cannot convert string to system.io.stream (on the file path) 2)cannot convert from bool to system.Text.Encoding 3)The name utf-8 encoding does not exist in the current context. The solution provided to a similar question is not working for me.
I could solve these errors by changing the code to
using (var streamWriter = new StreamWriter("D:\\path\\Output.csv", true, System.Text.Encoding.UTF8))
but it doesn't show "UTF-8 with bom" in my csv file notepad