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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.3
    • 6.5.6, 7.0.2
    • General
    • Security Level: Jimmy
    • None

      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."

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

              Created:
              Updated:
              Resolved: