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

Discussion in 'ASP .Net' started by Henke, Oct 18, 2004.

  1. Henke

    Henke Guest

    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
    Henke, Oct 18, 2004
    #1
    1. Advertising

  2. 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
    "Henke" <> wrote in message
    news:#...
    > 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
    >
    >
    Martin Dechev, Oct 18, 2004
    #2
    1. Advertising

  3. Henke

    Henke Guest

    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

    "Martin Dechev" <> skrev i meddelandet
    news:%...
    > 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
    > "Henke" <> wrote in message
    > news:#...
    >> 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
    >>
    >>

    >
    >
    Henke, Oct 18, 2004
    #3
  4. Hi Martin,
    I posted my error i had for the trreview control bit u didn't reply..
    Can u go through that pls!!
    Thx


    "Martin Dechev" <> wrote in message
    news:#...
    > 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
    > "Henke" <> wrote in message
    > news:#...
    > > 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
    > >
    > >

    >
    >
    Patrick.O.Ige, Oct 19, 2004
    #4
  5. 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
    "Henke" <> wrote in message
    news:#...
    > 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
    >
    > "Martin Dechev" <> skrev i meddelandet
    > news:%...
    > > 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
    > > "Henke" <> wrote in message
    > > news:#...
    > >> 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
    > >>
    > >>

    > >
    > >

    >
    >
    Martin Dechev, Oct 19, 2004
    #5
  6. Henke

    Henke Guest

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

    /Henke

    "Martin Dechev" <> skrev i meddelandet
    news:%23v$...
    > 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
    > "Henke" <> wrote in message
    > news:#...
    >> 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
    >>
    >> "Martin Dechev" <> skrev i meddelandet
    >> news:%...
    >> > 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
    >> > "Henke" <> wrote in message
    >> > news:#...
    >> >> 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
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
    Henke, Oct 19, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fredrik Melin

    Response.Write and Swedish characters?

    Fredrik Melin, Nov 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    535
    Fredrik Melin
    Nov 18, 2003
  2. Replies:
    0
    Views:
    393
  3. Wes-Securitas

    Swedish characters not displayed in datagrid

    Wes-Securitas, Jul 19, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    157
    Wes-Securitas
    Jul 19, 2004
  4. David Hag
    Replies:
    1
    Views:
    117
    Gunnar Hjalmarsson
    Dec 16, 2003
  5. John

    reading file containg passwords

    John, Nov 13, 2010, in forum: Perl Misc
    Replies:
    5
    Views:
    129
    Ted Zlatanov
    Nov 15, 2010
Loading...

Share This Page