Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

File dialog box is unable to show japanese characters. These characters are getting displayed on other browsers. Is there any special settings for this?

  • No replies
  • 3 have this problem

I have to download file from browser. When browser is displaying save dialog box then in that dialog box it is not displaying Japanese characters properly. These Japanese characters are getting displayed properly on other browsers. Here I am giving my java code which is opening that dialog box,

public static void export( HttpServletResponse resp, String data,

                            String encoding, String filename )
   throws ServletException
     byte[] bytes = data.getBytes( encoding );
     Assert.assertNotNull( bytes );
     filename = filename.replace( '/', '-' );
     filename = filename.replace( ':', '-' );
     resp.setContentType( "text/html; charset=UTF-8" );
     filename = java.net.URLEncoder.encode(filename,"UTF-8");
     resp.setHeader( "Content-Disposition",
                     "attachment;filename=\""+ new String(filename.getBytes()) + "\"");
     resp.setBufferSize( bytes.length );
     resp.setContentLength( bytes.length );
     resp.getOutputStream().write( bytes );
   catch( Exception ex )
     throw new ServletException( ex );

Additional System Details


  • User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1

More Information

In order to solve this problem I have tried UTF-8, UTF-16, UTF-32, US-ASCII encoding's. I have also tried different language settings of firefox mozilla browser. I have tried this on Japanese browser as well.
Note: I have to use this windows-7 and xp systems.