Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-2420

Trinidad doesn't support surrogate characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1.0-core
    • None
    • None

    Description

      [Problem Description:]
      Create a simple jsf page as below:
      <tr:inputText label="Label 1" id="it1"/>
      <tr:commandButton text="commandButton 1" id="cb1"/>

      In IE7, when we enter a surrogate character, then click submit button,
      surrogate character can be correctly displayed when page rendered.

      While in FF3, the surrogate character are displayed as 2 characters after
      clicked the submit button.
      NOTE: If using pre 7 jetty, the surrogate char will disappear (bug in jetty). I had to use JDeveloper to reproduce.

      [Test Data:]
      You can copy a sample surrogate character from:
      http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=%F0%A0%80%80

      Note: You must install surrogate font in your env to display the surrogate
      characters.

      [Analysis:]
      Check the html source of generated page, the surrogate character is written
      into 2 decimal value '��', and Firefox can't recognize these 2
      Decimal value as a single surrogate character.

      While in IE, it can recognize these 2 decimal value represent a single
      surrogate character.

      According to
      http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=%F0%A0%80%80, the decimal value for this surrogate character is 131072, if in html source code,
      we write "𠀀" instead of '��', the surrogate character
      can display well in both IE7 and FF3.

      Fix:
      The fix is to HTMLEscapes and XMLEscapes. if char is high-surrogate, use Character.getCodePoint and encode that.

      Attachments

        1. surrogateCharBug.patch
          10 kB
          Jeanne Waldman

        Activity

          People

            jeanne.waldman@oracle.com Jeanne Waldman
            jeanne.waldman@oracle.com Jeanne Waldman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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