Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2321

ZK fails when parsing rare unicode characters that require 2 UTF-16 chars

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.6, 7.0.2
    • Fix Version/s: 7.0.3
    • Component/s: General
    • Security Level: Jimmy
    • Labels:

      Description

      this simple zul file causes an error in ZK

      <zk>
       <label value="&#x23877;" />
      </zk>
      

      the character was taken from here http://www.fileformat.info/info/charset/UTF-16/list.htm?start=65536

      ERROR:

      org.zkoss.idom.DOMException: Invalid character(s): '?' (0xd84e) is not a valid XML character
      	at org.zkoss.idom.Verifier.checkCharacterData(Verifier.java:64)
      	at org.zkoss.idom.Attribute.setValue(Attribute.java:110)
      	at org.zkoss.idom.Attribute.<init>(Attribute.java:70)
      	at org.zkoss.idom.Attribute.<init>(Attribute.java:76)
      	at org.zkoss.idom.input.DefaultIDOMFactory.newAttribute(DefaultIDOMFactory.java:33)
      	at org.zkoss.idom.input.SAXHandler.startElement(SAXHandler.java:509)
      	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
      

      the unicode representation in Java has changed in Java 5 from unicode to UTF-16 or similar I assume the particular code has not been updated accordingly.

      http://en.wikipedia.org/wiki/UTF-16#Use_in_major_operating_systems_and_environments
      Paragraph starting with:
      "Java originally used UCS-2, and added UTF-16 supplementary character support in J2SE 5.0."

        Attachments

          Activity

            People

            • Assignee:
              jumperchen jumperchen
              Reporter:
              cor3000 cor3000
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: