How to set UTF-8 Encoding for a file (Not UTF-8 BOM) in Response stream

1.5k Views Asked by At

I am working with asp.net application with c#. I am trying let user download a file with an IIF extension to support QuickBooks integration.

Step 1: Save the file in web application domain path

enter image description here

After executing the above lines of code I opened the file using notepad++ and verified the encoding. it showed " Encode in UTF-8" checkedFile with UTF-8 Encode

  • The same saved file should be downloaded now from the application domain path.
  • I have written the following logic to done the downloading file job Download file from app domain using Response object
  • Unfortunately after downloading the file from app domain path encoding got changed to UTF-8-BOM.
  • I verified in Notepad++

The file encoding should be UTF-8 only. I have changed my code many times but still no luck.

0

There are 0 best solutions below