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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.4
    • Fix Version/s: 5.4
    • Component/s: tapestry-core
    • Labels:
      None
    • Environment:
      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

          Issue Links

            Activity

              People

              • Assignee:
                jkemnade Jochen Kemnade
                Reporter:
                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