Swedish characters

6 posts, 0 answers
  1. Kjell
    Kjell avatar
    203 posts
    Member since:
    May 2011

    Posted 01 Feb 2014 Link to this post

    There were many questions today.
    When i use example DBContentProvider and use Swedish characters like å, ä and ö in a file name it no problem to upload the file.
    But I can not open it?
    When i click on a filename like "Åland.doc" I go to a page with url: www.MyDomainNam.se/Handler.ashx?path=dokument%2fArbetsledare%2f%c3%85land.doc

    I use Collation: Finnish_Swedish_100_CI_AS and MS SQL 2008.
    In web.config i use:
    <globalization fileEncoding="iso-8859-1" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" culture="sv-SE" uiCulture="sv-SE" />

    How can I solve it?

    If i use FileExplorer with no DBContentProvider, i have no problem to open file with Swedish characters in the filename...
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 04 Feb 2014 Link to this post

    Hi Kjell,

    This is expected behaviour that is not caused by the special character in the file name but due to the type of the file you are trying to open.

    The DBContentProvider is using a handler to serve the files to the client and the file types that are not able to be displayed inside the browser (txt, jpg, gif, png, etc) the browser will try to download - the WriteFile() method in the Handler.ashx is handling the way files are served to the browser.

    Regards,
    Dobromir
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kjell
    Kjell avatar
    203 posts
    Member since:
    May 2011

    Posted 04 Feb 2014 in reply to Dobromir Link to this post

    Do not know if I understand you right now.
    If I upload a word document with the extension .doc and call it Åland (Swedish characters), then I can not open / download the file.
    However if I call the file Aland, I can open / download the file
  5. Vessy
    Admin
    Vessy avatar
    1386 posts

    Posted 06 Feb 2014 Link to this post

    Hi Kjell,

    What my colleague Dobromir means is that there should not be difference whether you are trying to open a file with or without a special character, as far as they are both with a ".doc" extension. The reason is that the browsers cannot render files of this type, so FileExplorer is also not able to provide such functionality.

    The expected behavior for each browser in such scenario will be to prompt you to download the file/open it outside the browser, and this what FileExplorer does - video with DB provider. In case that the control does not behave in this way on your end, could you try to isolate the problem into a sample fully runnable project including all needed references, so we could examine it on our side?

    Regards,
    Veselina Raykova
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.

  6. Kjell
    Kjell avatar
    203 posts
    Member since:
    May 2011

    Posted 06 Feb 2014 in reply to Vessy Link to this post

    I found the error. When I deleted the request coding="iso-8859-1" in globalization, it worked to download files with Swedish characters.
    Only problem with Internet Explorer, type the file name.
    I have try with request coding="UTF-8" however, no difference...
    For example, when I download Åland.doc becomes the name à ... land.doc
    Will figure out how to get to it ....
  7. Vessy
    Admin
    Vessy avatar
    1386 posts

    Posted 07 Feb 2014 Link to this post

    Hi Kjell,

    I delved a little bit more into the issue found that the problematic behavior is connected with the encoding made by the Response.Write() method in IE. This issue has been discussed a lot in the web with some workarounds provided. For example, you can start your research from the following threads:
    Response.Write - filename encoding wrong in Internet Explorer
    ASP.NET - Respose.Write() wrong endcoding

    I hope this information will be helpful for you.

    Regards,
    Veselina Raykova
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017