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

  • Thread starter Thread starter Henke
  • Start date Start date
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
 
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
 
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
 
Hi Martin,
I posted my error i had for the trreview control bit u didn't reply..
Can u go through that pls!!
Thx
 
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
 
Hi Martin!
Thank you verry much, that solved my problem. I doubt I'd found it my self!!

/Henke
 
Back
Top