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

  • Home
  • SEARCH
  • 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 6775761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:56:43+00:00 2026-05-26T15:56:43+00:00

I am using Memory-stream to write my data into Excel (used Unicode8F),however i have

  • 0

I am using Memory-stream to write my data into Excel (used Unicode8F),however i have some HINDI language characters in it as well.
After doing export to excel using C#,when I try to open up the exported excel in MS Excel 2010,the Hindi words are appearing in some roman characters.
Please help.
Do we need to make some change in the C# code or Do some setting in the Excel 2010 ?

Source code –

byte[] bytesToSend = System.Text.Encoding.UTF8.GetBytes(partialtorender);

System.IO.MemoryStream memStr = new System.IO.MemoryStream();

memStr.Write(bytesToSend, 0, bytesToSend.Length);

 memStr.Position = 0;

FileStreamResult result1 = new FileStreamResult(memStr, "application/ms-excel");

Response.AddHeader("content-disposition", "attachment; filename=" + "newExcelSheet" + ".xls");

return result1;
  • 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-05-26T15:56:44+00:00Added an answer on May 26, 2026 at 3:56 pm

    I replaced my code for Excel generation with this and it did wonders.

    string FileNameToShow = "newExcelSheet.xls";
    
    string FileType = "application/ms-excel";
    
     var cd = new ContentDisposition
                    {
                        Inline = false,
                        FileName = FileNameToShow
                    };
    
    Response.AddHeader("Content-Disposition", cd.ToString());
    
    return File(data, FileType);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SQLBULKCOPY to copy some data-tables into a database table, however, because the
How can i create a file and write to it using the memory stream?
When using memory-mapped files it seems it is either read-only, or write-only. By this
Is it possible to delete some images from the browser (firefox2) memory using javascript?
I'm using an XsltCompiledTransform to transform some XML into a fragment of HTML (not
I'm having a problem writing Norwegian characters into an XML file using C#. I
I'm using XML to record a stream of data. I know, there are better
I am writing a class that compresses binary data using a zlib stream. I
i'd like to read binary data from a blob, using the Stream interface around
I have been using the following code to Compress data in .Net 4.0: public

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.