-2

I am trying to download the excel file with Japanese/Chinese character. It look like it works on IE 8 only and not on firefox.

  • 2
    @RemcoGerlich That's the worst advice I ever heard. – MC Emperor May 29 '17 at 13:45
  • 1
    How is your download routine implemented? – Haroldo_OK May 29 '17 at 13:46
  • @MCEmperor: but without any more details than this, it's the best advice possible IMO. He only needs to use it for the one file. – RemcoGerlich May 29 '17 at 13:49
  • 2
    Probably a [mcve] would help. – GhostCat May 29 '17 at 13:51
  • Excel is a binary file. So I'm a bit confused about the mention of UTF-8 character set. Maybe the file is read as text instead of raw binary? But without the code it is impossible to be sure. – vanje May 29 '17 at 13:59
  • You haven’t told us how you’re trying to download it. Are you trying to use Java code to download it? Are you trying to use a browser to download a file from a servlet you wrote? If we don’t know what you’re doing, how can suggest how to fix it? – VGR May 29 '17 at 16:25

1 Answers1

0

Try below code .

String fileName = URLEncoder.encode(fileName, "UTF-8");
response.setHeader("Content-Disposition","attachment; filename="+fileName);
kiran
  • 77
  • 1
  • 11