First things first, I'm using Tomcat 5.5.1. I'm moving some code from a 
JSP document to tag files. All of the files are in XML format. The head 
of one of my tag files looks like this

<?xml version="1.0" encoding="ISO-8859-1"?>

<jsp:root version="2.0"
 xmlns:jsp="http://java.sun.com/JSP/Page";>

  <jsp:directive.tag pageEncoding="ISO-8859-1" />
  <jsp:directive.tag body-content="empty"/>


I'm precompiling the file with this ant target

  <target name="jspc" depends="prepare">
    <mkdir dir="${build.home}/WEB-INF/src"/>
    <jasper2 
     javaencoding="UTF-8"
     validateXml="false"
     compile="false"
     uriroot="${build.home}" 
     webXmlFragment="${build.home}/WEB-INF/generated_web.xml" 
     addwebxmlmappings="true"
     outputDir="${build.home}/WEB-INF/src" /> 
  </target>

So far, all is working. Problems start, when the file contains 
characters or constants such as '�' and '&#160;'. These result in 
errors like this

An error occurred at line: 47 in the jsp 
file: /WEB-INF/tags/veranstaltung.tagx
Generated servlet error:
Invalid character constant

The tag file is indeed encoded as ISO-8859-1. Alternatively, I tried 
UTF-8, with the declarations changed, too. The result was the same. And 
now for the weird part:

This doesn't compile
<span>�</span>

This either
<span>�
 </span>

But this does
<span>�
  </span>

And so does this
<span>�   </span>

So, there have to be 3 whitespace characters after the umlaut to make it 
pass through jasper. =:-O


Michael

-- 
Michael Schuerig                         Those people who smile a lot
mailto:[EMAIL PROTECTED]                             Watch the eyes
http://www.schuerig.de/michael/    --Ani DiFranco, Outta Me, Onto You

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to