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

StringEscapeUtils.escapeXml(str) does not support supplemental characters.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 3.0
    • Component/s: lang.*
    • Labels:

      Description

      Hello.

      StringEscapeUtils.escapeXml(str) escapes Unicode characters greater than 0x7f to their numerical
      u equivalent:

      String str = StringEscapeUtils.escapeXml("\uD84C\uDFB4");
      System.out.println(str);
      //��

      But, the output should be 𣎴.

      According to W3C document "Using character escapes in markup and CSS," We must use the single, code point value for supplemental character.
      http://www.w3.org/International/questions/qa-escapes

      In fact, �� is not rendered correctly in some web browsers e.g., Firefox 5.0 and Chrome 12.0.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yabuki Taro Yabuki
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: