ICEfaces
  1. ICEfaces
  2. ICE-10987

ace:dataExporter - add support for the encoding attribute

    Details

      Description

      By default the encoding attribute of the ace:dataExporter sets the encoding to UTF-8. If this attribute is changed to use 'ANSI' for example, it will still encoding the content with UTF-8.

        Activity

        Arran Mccullough created issue -
        Hide
        Arran Mccullough added a comment -

        Uploaded test case that shows this issue.

        Steps:

        • Load welcomeICEfaces.jsf
        • Export the content of the table and save the file some where.
        • Open the csv file with an editor, Notepad++ for example. Looking at the encoding it is set to UTF-8 not ANSI
        Show
        Arran Mccullough added a comment - Uploaded test case that shows this issue. Steps: Load welcomeICEfaces.jsf Export the content of the table and save the file some where. Open the csv file with an editor, Notepad++ for example. Looking at the encoding it is set to UTF-8 not ANSI
        Arran Mccullough made changes -
        Field Original Value New Value
        Attachment Case13728Example.war [ 22119 ]
        Attachment Case13728Example.zip [ 22120 ]
        Ken Fyten made changes -
        Assignee Arturo Zambrano [ artzambrano ]
        Fix Version/s EE-4.1.0.GA [ 12171 ]
        Fix Version/s EE-3.3.0.GA_P04 [ 12270 ]
        Assignee Priority P2 [ 10011 ]
        Hide
        Arturo Zambrano added a comment -

        r48575: added support for the encoding attribute in ace:dataExporter for the CSV and XML formats.

        Testing notes, documentation and other notes to follow.

        Show
        Arturo Zambrano added a comment - r48575: added support for the encoding attribute in ace:dataExporter for the CSV and XML formats. Testing notes, documentation and other notes to follow.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #48575 Tue Mar 29 15:30:23 MDT 2016 art.zambrano ICE-10987 added support for the encoding attribute in ace:dataExporter for the CSV and XML formats
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/DataExporter.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/CSVExporter.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/XMLExporter.java
        Ken Fyten made changes -
        Affects Version/s 3.0 [ 10241 ]
        Affects Version/s 4.1.1 [ 12972 ]
        Ken Fyten made changes -
        Affects Version/s EE-3.3.0.GA [ 10572 ]
        Ken Fyten made changes -
        Summary ace:dataExporter - encoding attribute has no effect ace:dataExporter - add support for the encoding attribute
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Hide
        Arturo Zambrano added a comment -

        r48583: added 'pdfFont' attribute to specify a custom font for the exported PDF file and added TLD documentation regarding encoding

        Show
        Arturo Zambrano added a comment - r48583: added 'pdfFont' attribute to specify a custom font for the exported PDF file and added TLD documentation regarding encoding
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #48583 Wed Mar 30 17:29:59 MDT 2016 art.zambrano ICE-10987 added 'pdfFont' attribute to specify a custom font for the exported PDF file and added TLD documentation regarding encoding
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/DataExporterMeta.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/PDFExporter.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/Exporter.java
        Hide
        Arturo Zambrano added a comment - - edited

        Testing notes:

        • Please read the new TLD documentation for the 'encoding' and 'pdfFont' attributes.
        • Test the CSV, XML, and PDF formats separately (The XLS format is not affected by these changes).
        • The test app needs to be modified and tested as explained below. Simply checking the Encoding menu in Notepad++ is not a reliable way to determine the encoding, since Notepad++ simply gives its best guess as to the encoding in use. There's nothing in plain text files to inform the readers/viewers what encoding is being used.
        • Modify the test app by including some Unicode characters either in the XHTML file or hardcoded in the Java bean. The characters in the Java bean must be escaped, using the Java format (i.e. \u0000) in order for them to be displayed and exported correctly. The only Unicode character in the attached test app is not escaped, so it won't be displayed correctly, unless it's escaped. In the XHTML file, Unicode characters must be escaped in the XML format (i.e. &#x0000; ), unless the encoding is explicitly declared in the xml prolog (e.g. <?xml version='1.0' encoding='UTF-8' ?> ), in which case Unicode characters can be typed directly.
        • For example, you can use these escaped characters in Java '\u0407 \u03fe \u0401' and these escaped characters in XHTML '&#x0407; &#x03FE; &#x0401;'.
        • You can test the plain text formats (CSV and XML) by specifying the UTF-8 encoding (or simply not including the 'encoding' attribute, since UTF-8 is the default encoding) and verifying that Unicode characters can be viewed correctly in a text editor. Then, you can change the encoding to 'US-ASCII' or 'Windows-1252' and see that Unicode characters are replaced by question marks. The 'ANSI' value is not an official encoding type.
        • You can test the PDF format by specifying the absolute path to a font file in the host system, using the 'pdfFont' attribute. I recommend using the most common TrueType fonts like Arial, Helvetica, Times New Roman, etc., since the font itself has to support the desired encoding in order to be used, and popular fonts usually support Unicode (Courier and other terminal/console fonts might not support Unicode completely or at all). Once the PDF document is exported, verify that Unicode characters are displayed correctly (if 'UTF-8' was the specified encoding) and that specified font was actually used in the document.
        • More information will be added to the wiki page.
        Show
        Arturo Zambrano added a comment - - edited Testing notes: Please read the new TLD documentation for the 'encoding' and 'pdfFont' attributes. Test the CSV, XML, and PDF formats separately (The XLS format is not affected by these changes). The test app needs to be modified and tested as explained below. Simply checking the Encoding menu in Notepad++ is not a reliable way to determine the encoding, since Notepad++ simply gives its best guess as to the encoding in use. There's nothing in plain text files to inform the readers/viewers what encoding is being used. Modify the test app by including some Unicode characters either in the XHTML file or hardcoded in the Java bean. The characters in the Java bean must be escaped, using the Java format (i.e. \u0000) in order for them to be displayed and exported correctly. The only Unicode character in the attached test app is not escaped, so it won't be displayed correctly, unless it's escaped. In the XHTML file, Unicode characters must be escaped in the XML format (i.e. &#x0000; ), unless the encoding is explicitly declared in the xml prolog (e.g. <?xml version='1.0' encoding='UTF-8' ?> ), in which case Unicode characters can be typed directly. For example, you can use these escaped characters in Java '\u0407 \u03fe \u0401' and these escaped characters in XHTML '&#x0407; &#x03FE; &#x0401;'. You can test the plain text formats (CSV and XML) by specifying the UTF-8 encoding (or simply not including the 'encoding' attribute, since UTF-8 is the default encoding) and verifying that Unicode characters can be viewed correctly in a text editor. Then, you can change the encoding to 'US-ASCII' or 'Windows-1252' and see that Unicode characters are replaced by question marks. The 'ANSI' value is not an official encoding type. You can test the PDF format by specifying the absolute path to a font file in the host system, using the 'pdfFont' attribute. I recommend using the most common TrueType fonts like Arial, Helvetica, Times New Roman, etc., since the font itself has to support the desired encoding in order to be used, and popular fonts usually support Unicode (Courier and other terminal/console fonts might not support Unicode completely or at all). Once the PDF document is exported, verify that Unicode characters are displayed correctly (if 'UTF-8' was the specified encoding) and that specified font was actually used in the document. More information will be added to the wiki page.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #48584 Wed Mar 30 17:49:12 MDT 2016 art.zambrano ICE-10987 TLD documentation addition
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/DataExporterMeta.java
        Hide
        Arturo Zambrano added a comment -

        r48585: committed improvements to the 3.3 EE maintenance branch

        Show
        Arturo Zambrano added a comment - r48585: committed improvements to the 3.3 EE maintenance branch
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Carmen Cristurean added a comment - - edited

        ICEfaces4 trunk r48585: verified on Firefox41, IE11, Chrome49, MS Edge, no issues found.
        Added QA dataExporter 'enconding' and 'pdfFont' test: http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/dataExporter
        Test page: /dataExporterEncoding.jsf

        Show
        Carmen Cristurean added a comment - - edited ICEfaces4 trunk r48585: verified on Firefox41, IE11, Chrome49, MS Edge, no issues found. Added QA dataExporter 'enconding' and 'pdfFont' test: http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/dataExporter Test page: /dataExporterEncoding.jsf
        Ken Fyten made changes -
        Fix Version/s EE-4.1.0.BETA [ 13072 ]
        Judy Guglielmin made changes -
        Assignee Arturo Zambrano [ artzambrano ] Judy Guglielmin [ judy.guglielmin ]
        Judy Guglielmin made changes -
        Reporter Arran Mccullough [ arran.mccullough ] Judy Guglielmin [ jguglielmin ]
        Judy Guglielmin made changes -
        Assignee Judy Guglielmin [ judy.guglielmin ] Arturo Zambrano [ artzambrano ]
        Judy Guglielmin made changes -
        Reporter Judy Guglielmin [ jguglielmin ] Arran McCullough [ amccullough ]
        Ken Fyten made changes -
        Fix Version/s 4.2.BETA [ 13091 ]
        Fix Version/s 4.2 [ 12870 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arran McCullough
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: