JSP is not handled by the Lucee cfml servlet, thus, it’s just a comparison that is very similar to comparing the output to a .php, .aspx or whatever.
You need to verify if all the charsets you are using are in harmony along the entire flow/stream. You are probably saving your cfml templates as UTF-8 but Lucee is set to use it differently. You might need to change it in the Lucee admin.
Please see also the following similar issue here for a more detailed/comprehensive explanation:
But the issue seems to be Lucee related - Lucee-5.3.4.80
Tried same testing code in Railo, it works.
As the testing code shows - The plain JSP Arabic works fine, the cfoutput Arabic works fine. It only breaks when embedding a JSP file within the CFM. I am guessing that GetPageContext.include() is doing something internally…
And thru tests, the CFM embedded JSP prints response.getCharacterEncoding() to ISO-8859-1, and that encoding is not able to be overridden by any Servlet Filters. Apparently that JSP includes happens before/internally with the default ISO-8859-1 encoding.
PS: I’ve tried configuring Lucee Administration → Charset All to UTF-8 and the issue still exists.
I’m not sure, could you please elaborate… are you trying to run a jsp file and include a JSP output into cfml?
I really don’t think that your jsp file is run by the jsp servlet. Your PageContext() is probably coming from the Lucee cfml engine, thus you are probably including that test.jsp as cfml and it’s very likely it is just outputting your jsp code as static. To be sure it is working, try adding this to your test.jsp to see its getting echoed:
<%= (new java.util.Date()).toLocaleString()%>
I’m pretty sure you won’t see anything, your browser should interpret that as an empty tag. Could you please confirm that?
Lucee and CFML works, as you can see in:
Update: now I’m understanding what you are trying to do. Sorry for not getting it right. I’ve no experience doing that. Maybe someone else more experienced in cfml and working with jsp may have an answer.
The HttpServletResponseWrap basically overrides the response charset to ISO-8859-1 - always, in which case, the GetPageContext.include is always using ISO-8859-1 encoding and it is unable to be changed/reset by other configurations/processes.
This issue exists in Railo-3.1.2.001 and I think this comes along to Lucee.
Looks like this code needs to either access the underlying CoyoteResponse which contains the correct character encoding, but also should be defaulting to the current pageContext’s character encoding too