Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2219

XML-Parsing broken if system encoding is not UTF-8

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.4
    • 5.4
    • tapestry-core
    • None
    • Windows (probably linux too but most systems run with utf-8)

    Description

      Tapestry reads tml files in XMLTokenStream.openStream(), does some doctype "magic" and writes all the file content's into a ByteOutputStream. On T5.3 reading/writing was done using the system's caracter encoding. With T5.4 that was changed for the reader but not for the writer. This messes up all non-ascii characters if system encoding is not utf-8.

      Solution: Change
      PrintWriter writer = new PrintWriter(bos);
      To
      PrintWriter writer = new PrintWriter(new OutputStreamWriter(bos, "UTF8"));

      in XMLTokenStream.openStream().

      TODO: Unit test for XMLTokenStream (follows soon)

      Attachments

        1. XMLTokenStreamTests.java
          4 kB
          Michael Wyraz

        Issue Links

          Activity

            People

              jkemnade Jochen Kemnade
              michael@wyraz.de Michael Wyraz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified