<?xml version="1.0" encoding="ISO-8859-1"?><page xmlns:xsp-interpolation="http://apache.org/xsp/interpolation/1.0" xmlns:xsp="http://apache.org/xsp">
    <title>Escaping of non-ASCII characters</title>
    <content>
      

      

      <p>
        For the various Java compilers which have been interfaced to Cocoon
        there is no unified method to tell the compiler the encoding of the
        Java source.
        Some compilers always assume UTF-8, others deduce it from the
        systems locale settings.
      </p>

      <p>
        If there is a mismatch in the encodings, umlauts, accents,
        and other international characters will be mutilated in the output.
        In order to avoid this problem, XSP preprocesses all Java code and
        converts all non-ASCII characters to their \u1234 equivalent.
        Thus the Java compiler sees only ASCII characters, and the encoding
        becomes irrelevant (at least for character sets such as ISO-8859-1
        which coincide which ASCII in the lower 128 characters).
      </p>

      <p>
        Older Cocoon versions omitted to do the \u1234 conversion in some of
        the XSP contexts where Java string constants could be used.
      </p>

      <p>
        In Cocoon 2.1.8 this is now fixed, as this test is supposed to show:
      </p>
      <table border="1">
        <tr>
          <th>Context</th>
          <th>Result</th>
        </tr>
        <tr>
          <td>xsp:page/xsp:logic</td>
          <td>Héllô "wörld"! 1</td>
        </tr>
        <tr>
          <td>xsp:page/xsp:init-page</td>
          <td>Héllô "wörld"! 2</td>
        </tr>
        <tr>
          <td>xsp:init-page/xsp:expr</td>
          <td>Héllô "wörld"! 3</td>
        </tr>
        <tr>
          <td>xsp:page/xsp:exit-page</td>
          <td>Héllô "wörld"! 4</td>
        </tr>
        <tr>
          <td>xsp:exit-page/xsp:expr</td>
          <td>Héllô "wörld"! 5</td>
        </tr>
        <tr>
          <td>xsp:logic</td>
          <td>Héllô "wörld"! 6</td>
        </tr>
        <tr>
          <td>xsp:logic/xsp:expr</td>
          <td>Héllô "wörld"! 7</td>
        </tr>
        <tr>
          <td>xsp:content/xsp:expr</td>
          <td>Héllô "wörld"! 8</td>
        </tr>
        <tr>
          <td>xsp:expr</td>
          <td>Héllô "wörld"! 9</td>
        </tr>
        <tr>
          <td>text()</td>
          <td>Héllô "wörld"! 10</td>
        </tr>
        <tr>
          <td>attribute</td>
          <td><img src=".gif" alt="Héllô &quot;wörld&quot;! 11"/></td>
        </tr>
        <tr>
          <td>xsp:attribute/text()</td>
          <td><img src=".gif" alt="Héllô &quot;wörld&quot;! 12"/></td>
        </tr>
        <tr>
          <td>xsp:attribute/xsp:expr</td>
          <td><img src=".gif" alt="Héllô &quot;wörld&quot;! 13"/></td>
        </tr>
      </table>
    </content>
  </page>