2 Replies Latest reply on Feb 14, 2013 1:50 PM by Joe Upshaw

    Problem with characters encoding

      Hi to all.

      I'm trying to create page for file download as described Generate XML FILE FROM APEX. Now I have following problem: I open created file (csv report) with MS Excel. Excel works with win1251 encoding, but file contains unicode characters. As result I see unreadable symbols.
      NLS_CHARACTERSET during report generation is CL8MSWIN1251, language in application properties is 'Russian'. As I understand, file is generated in win1251 encoding and is changed somewhere else, maybe on web server.
      In the same time, standard csv reports (from reports and interactive reports) are generated in correct encoding (win1251).
      How can I create files in required encoding?

      Versions: oracle - 11g, APEX - 4.2.1.
        • 1. Re: Problem with characters encoding
          Joe Upshaw
          You need to specify the characterset encoding in the file itself, e.g.
          OWA_UTIL.MIME_HEADER( 'text/html',  False, 'UTF8' );
          HTP.P( 'Content-Disposition: attachment; filename=' || ls_DefaultFileName );
          HTP.META( 'Content-Type',  null, 'text/html; charset=utf-8' );           
          HTP.TITLE( ls_RiskMatrixTitle );  
          • 2. Re: Problem with characters encoding
            Joe Upshaw
            Notice that, unlike the post you refer to, my sample explicitly sets the charset both in the mime header and the doc (the UTF8 stuff).