<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I was debugging a JSword problem with OSIS documents having SMP Unicode characters. (These are characters that have more than two bytes in UTF-8.)<div class=""><br class=""></div><div class="">The character was a “speech balloon” and was used for a note marker (i.e. n attribute value on note, &lt;note n=“marker”&gt;). The first occurrence it was rendered once, the second occurrence 2x and so forth. It wasn’t limited to the chapter, but the number of times the character was seen since starting the app.</div><div class=""><br class=""></div><div class="">I traced it the embedded Xalan XML parser embedded in Java. The trouble is that the embedded version is quite old. Even in Java 8. Replacing it with the latest from Apache (also did Xerces) and other dependencies fixed the problem.</div><div class=""><br class=""></div><div class="">This was found in STEP and Bible Desktop, which use Java from Oracle. It may or may not be a problem in Android.</div><div class=""><br class=""></div><div class="">Here is what the Apache Xalan FAQ says to override the embedded version:</div><div class=""><blockquote type="cite" class=""><p style="font-family: arial, 'lucida console', san-serif; font-size: 16px;" class="">To use a newer version of Xalan-Java and override the one packaged with the JDK:</p><ul style="font-family: arial, 'lucida console', san-serif; font-size: 16px;" class=""><li class="">use the&nbsp;<a href="http://java.sun.com/j2se/1.4.2/docs/guide/standards/" style="color: blue;" class="">Endorsed Standards Override Mechanism</a>. Place the xalan.jar, serializer.jar, xercesImpl.jar and xml-apis.jar in the &lt;java-home&gt;\lib\endorsed directory, where &lt;java-home&gt; is where the runtime software is installed.</li></ul></blockquote>Here is the page that discusses the Endorsed Standards Override Mechanism:</div><div class=""><a href="http://docs.oracle.com/javase/8/docs/technotes/guides/standards/index.html" class="">http://docs.oracle.com/javase/8/docs/technotes/guides/standards/index.html</a></div><div class=""><br class=""></div><div class="">Note: Project Jigsaw will provide a different mechanism in Java 9.</div><div class=""><br class=""></div><div class="">There are a couple of ways to do this depending on whether you are embedding Java in your “app”, using a web server or using Java provided by the end user.</div><div class=""><br class=""></div><div class="">In the last case, you put the 4 jars mentioned above into the same directory as your other jars and add to the command line the following flag:</div><div class="">-Djava.endorsed.dirs=/path/to/my/jar/folder</div><div class=""><br class=""></div><div class="">Hope this helps.</div><div class=""><br class=""></div><div class="">DM</div><div class=""><br class=""></div></body></html>