Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-448

Lower Ascii Characters don't get encoded by Entities.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4
    • 3.0
    • lang.*
    • None
    • N/A

    Description

      I have an XML files which sometimes contain control characters like 0x0c, or 0x18. These aren't allowed to be directly in the file (the validator fails with invalid character), so they need to be escaped.

      When using "StringEscapeUtils.escapeXml(String str)", which in turn uses "Entities.escape(Writer writer, String str)", these characters don't get escaped. Only characters above 0x7F get escaped.

      I fixed this bug, and attached a patch.

      Attachments

        1. lowerascii.patch
          0.5 kB
          Quintin Beukes

        Issue Links

          Activity

            People

              Unassigned Unassigned
              apache.org@add.za.net Quintin Beukes
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: