JBehave
  1. JBehave
  2. JBEHAVE-980

Allow configuration of report view encoding

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.9.1
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Non-English story files
    • Number of attachments :
      0

      Description

      The JBehave HTML reports are created using encoding "ISO-8859-1".

      Normally there should be no problems with umlauts when using this encoding. But nevertheless my umlauts in the story name are not shown correctly when opening the JBehave reports.html file in a browser. This is why the link to the details of the result for that story is broken.

      If I change the browser encoding to "UTF-8", the umlaut is displayed correctly

      Why does this occur? Because my Eclipse project is set to UTF-8 to be used as default encoding and JBehave uses in its HTML generation template hardcoded "ISO-8859-1".

      JBehave produces this line in the HTML and the browser displays it initially in this encoding:

      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

      Some ideas to improve this:

      Instead of "charset=ISO-8859-1" it could be used "charset=UTF-8".
      Or it could be made configurable via the MostUsefulConfiguration.

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Affects Version/s 3.9.1 [ 19830 ]
        Fix Version/s 3.9.1 [ 19830 ]
        Mauro Talevi made changes -
        Summary HTML report: "charset=ISO-8859-1" not suitable for all use cases Allow configuration of report view encoding
        Hide
        Mauro Talevi added a comment - - edited

        Made encoding configurable via StoryReporterBuilder view properties.

        Configuration.storyReporterBuilder().viewResources().setProperty("encoding","UTF-8")

        Updated LocalizedStories in i18n examples to show its use.

        Show
        Mauro Talevi added a comment - - edited Made encoding configurable via StoryReporterBuilder view properties. Configuration.storyReporterBuilder().viewResources().setProperty("encoding","UTF-8") Updated LocalizedStories in i18n examples to show its use.
        Mauro Talevi made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Mauro Talevi added a comment -

        A new snapshot has been deployed. Can you please test it with your configured encoding?

        Show
        Mauro Talevi added a comment - A new snapshot has been deployed. Can you please test it with your configured encoding?
        Hide
        Otto Diesel added a comment -

        Excuce me for the late reply.

        I tested it with JBehave 3.9.4 and it works for me.

        Thank you very much!

        Show
        Otto Diesel added a comment - Excuce me for the late reply. I tested it with JBehave 3.9.4 and it works for me. Thank you very much!

          People

          • Assignee:
            Unassigned
            Reporter:
            Otto Diesel
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: