I have this part of code
Response.Charset = _encodingcode;
Response.AddHeader("Content-Encoding", _encodingcode);
Response.HeaderEncoding = Encoding.GetEncoding(_encodingcode);
Response.ContentEncoding = Encoding.GetEncoding(_encodingcode);
Response.ContentType = mimeType;
return File(_filedata, mimeType, $"{id}{_extension}");
But always when download the file the notepad's encoding is ANSI