Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7987239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:05:22+00:00 2026-06-04T12:05:22+00:00

For some reason, when I open a CSV file, that appears totally fine in

  • 0

For some reason, when I open a CSV file, that appears totally fine in Excel and Notepad, in Microsoft Works, there are some strange characters appearing as the first thing in the file. By first thing I mean they appear in cell A1, before the text that appears in that cell.

Here is an example file

Illustration carrier,Net death benefit,Issue date,Issue state,Policy type,Member lives,Policy date,Termination of coverage,Termination of coverage action required,Accumulated value,AV,SV,Illustrated Annual Level Premiums,LP to NDB ratio,Premium financed,Name of program,Primary insured age,Primary insured gender,Secondary insured age,Secondary insured gender,Current bid,Time left,Bid1,Bid2,Bid3,Bid4,Bid5,Bid6,Bid7,Bid8,Bid9,Bid10,Bid11,Bid12,Bid13,Bid14,Bid15,Bid16,Bid17,Bid18,Bid19,Bid20
srwer,$0.00,14/05/2012,us state 2,policy Type 1,member life 4,16/05/2012,-,,$0.00,-,-,,Not yet implemented,no,,0y 0m,Demale,,Female,$0.00,"2 days, 7 hours, 51 minutes, 36 seconds".

I create these files in my application using this method

protected ActionResult ExportToCSV(string csvExport)
{
   var output = new MemoryStream();
   var writer = new StreamWriter(output, Encoding.UTF8);

   writer.Write(csvExport);

   writer.Flush();
   output.Position = 0;

   return File(output, "text/comma-seperated-values", "export.csv");
}

I have a few questions

  1. Is there a way to change this code to save the files in ANSI format?
  2. Will I be able to view the files perfectly in Notepad, Works and Excel?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:05:23+00:00Added an answer on June 4, 2026 at 12:05 pm

    I suspect it’s the UTF-8 byte order mark:

    
    

    By convention, the presence of these characters at the beginning of a file indicate that the file is encoded using UTF-8. Modern applications look for these characters and automatically remove them if they exist. But Microsoft Works is an old application that probably doesn’t support UTF-8.

    To remove the characters, you can open the file in Notepad, choose File > Save As, and select ANSI in the Encoding drop-down list.

    UPDATE: If you need to support old non-Unicode applications like Microsoft Works, then you can specify Encoding.ASCII or Encoding.Default when creating a text file in .NET. But MSDN Library cautions:

    Different computers can use different encodings as the default, and the default encoding can even change on a single computer. Therefore, data streamed from one computer to another or even retrieved at different times on the same computer might be translated incorrectly. In addition, the encoding returned by the Default property uses best-fit fallback to map unsupported characters to characters supported by the code page. For these two reasons, using the default encoding is generally not recommended. To ensure that encoded bytes are decoded properly, your application should use a Unicode encoding, such as UTF8Encoding or UnicodeEncoding, with a preamble. Another option is to use a higher-level protocol to ensure that the same format is used for encoding and decoding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the below code to open a CSV file, but for some reason
Background: For some reason, whenever a user tries to open an xslx (excel 2007)
For some reason I can't get open() to open a file. Here's my code.
I am trying to open a file but for some reason I cannot even
For some reason I get this: 1>LINK : fatal error LNK1104: cannot open file
For some reason, I was under the impression that it was just called Timeout,
For some reason I have always assumed that most of the time a variable
For some reason, the files in the database won't open if they have the
I'm trying to open a new window, and for some reason the scrollbars will
Emacs noob here, For some reason, when I try to Open a existing C++

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.