Bug 66536 - tagsfiles seem to be compiled with the wrong source encoding
Summary: tagsfiles seem to be compiled with the wrong source encoding
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 9.0.73
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2023-03-21 13:47 UTC by Holger Klawitter
Modified: 2023-03-22 17:16 UTC (History)
0 users

minimal webapp (1.36 KB, application/zip)
2023-03-21 13:47 UTC, Holger Klawitter

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Klawitter 2023-03-21 13:47:54 UTC
Created attachment 38526 [details]
minimal webapp

Hi there,

When I let tomcat/jasper compile the following tag file 

<%= "ü does not work" %> // bytes c3 bc

compiles into umlaut_tag.java in which the umlaut is doubly utf-8 encoded
like this:

      out.print( "ü does not work" ); // bytes c3 83 c2 bc

String literals in jsp files work just fine, so I'd like to rule out
errors in my encoding setup.

(Tomcat is running with LC_ALL=de_DE.UTF-8.)

I've attached a minimal webapp demonstrating that jsp is working, but the tag files are not.

Comment 1 Mark Thomas 2023-03-22 17:16:47 UTC
Thanks for the report. I can confirm that this is a Tomcat bug.

Fixed in:
- 11.0.x for 11.0.0-M5 onwards
- 10.1.x for 10.1.8 onwards
-  9.0.x for  9.0.74 onwards
-  8.5.x for  8.5.88 onwards

It you want a short-term work-around, add a single space character after <%@tag and before the newline.