Problems opening a file containg å,ä or ö (swedish characters)

H

Henke

Hi!

I have streamed files to a database and use Response.BinaryWrite to open
them. When the file name contains å,ä or ö they get replace by for example
Ã¥. I have tried changing the CharSet on the Response object but it didn't
solved my problem.
Does anybody know how the fix this problem?

/Henke
 
M

Martin Dechev

Hi,

It seems that the text is sent encoded in utf-8 or some other unicode
encoding, but the browser decodes it as ascii. What happens if you change
the encoding in the browser manually? Do you see the text (the characters in
question) ok?

If yes, try setting the Response.Charset to the correct one, for example
"utf-8".

Hope this helps
Martin Dechev
ASP.NET MVP
 
H

Henke

Thanks for your answer!
I looked i my IE and found out that the encoding was set to UTF-8, so I set
the Response.Charset to "UTF-8" but it didn't help. It's just in the
Download File - dialog that the filename gets wrong. ANy other ideas?

/Henke
 
P

Patrick.O.Ige

Hi Martin,
I posted my error i had for the trreview control bit u didn't reply..
Can u go through that pls!!
Thx
 
M

Martin Dechev

Hi,

Try to UrlEncode the filename - in the header:

Response.AppendHeader("content-disposition", "attachment; filename=" +
Server.UrlEncode("test with å, ä and ö.txt"));

Hope this helps
Martin Dechev
ASP.NET MVP
 
H

Henke

Hi Martin!
Thank you verry much, that solved my problem. I doubt I'd found it my self!!

/Henke
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top