UTF-8

  • Thread starter Mike Gleason jr Couturier
  • Start date
M

Mike Gleason jr Couturier

Hi,

I'm uploading a text file (.csv) dynamically to the client with this method
:

--
Response.Clear();
Response.AddHeader("Content-disposition:", "attachment;
filename=export.csv");
Response.AddHeader("Content-type", "application/vnd.ms-excel");
Response.ContentEncoding = Encoding.UTF8;

Response.Write([...]);
Response.Write([...]);

Response.End();
--
Some accentuated acharacters does not display correctly in excel... but when
I open the file the characters are displayed fine.. and notepad tells me
that the file is indeed a UTF-8 file (when file/save as)..

Im I missing something here? (apparently yes!)

Thanks guys (and or gals)

Mike
 
M

Mike Gleason jr Couturier

Mike Gleason jr Couturier said:
Hi,

I'm uploading a text file (.csv) dynamically to the client with this
method :

--
Response.Clear();
Response.AddHeader("Content-disposition:", "attachment;
filename=export.csv");
Response.AddHeader("Content-type", "application/vnd.ms-excel");
Response.ContentEncoding = Encoding.UTF8;

Response.Write([...]);
Response.Write([...]);

Response.End();
--
Some accentuated acharacters does not display correctly in excel... but
when I open the file the characters are displayed fine.. and notepad tells
me that the file is indeed a UTF-8 file (when file/save as)..

Im I missing something here? (apparently yes!)

Thanks guys (and or gals)

Mike

I've managed to get it done by:

Response.AddHeader("Content-disposition:", "attachment;
filename=export.csv");
Response.AddHeader("Content-type", "application/vnd.ms-excel;
charset=ISO-8859-1");
Response.Charset = "ISO-8859-1";
Response.ContentEncoding = Encoding.GetEncoding("ISO-8859-1");
I don't really need UTF8... my text was in latin iso :|

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,696
Latest member
BarbraOLog

Latest Threads

Top