Setting an SSI variable to a value containing UTF-8 characters and then echoing it yields output with HTML entities for each of the two bytes of each UTF-8 character. E.g.: <!--#set var="DEFAULT_APPLICATION_DESCRIPTION" value="den CAS-tjänst du besökte" --> <!--#set var="APPLICATION_DESCRIPTION" value="${DEFAULT_APPLICATION_DESCRIPTION}" --> Du är nu utloggad ur <!--#echo var="APPLICATION_DESCRIPTION" -->. ...yields (in browser): Du är nu utloggad ur den CAS-tjänst du besökte. ...instead of (in browser): Du är nu utloggad ur den CAS-tjänst du besökte. ...and in HTML: Du är nu utloggad ur den CAS-tjänst du besökte. ...instead of in HTML: Du är nu utloggad ur den CAS-tjänst du besökte. This was not so in Apache 2.2.11. The .shtml page is in UTF-8 (with BOM) and has: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> In httpd.conf, AddDefaultCharset is NOT set (so uses default value).
I guess this is caused by the fix for PR25202 (r730296, r732583). This might be tricky to fix.
The mod_include docs do clearly state that, for echo, a) encoding=entity is the default, and b) encoding=entity will not work correctly if a character encoding other than ISO-8859-1 is in use For the example given here, at least, using <!--#echo encoding="none" var="..." would be the correct use, surely? But the potential for breaking backwards compat in bug 25202 does seem to have been clearly called. Iwan Stanley's approach in bug 25202 comment 7 seems vastly preferable to the change which got committed.
(In reply to comment #2) > For the example given here, at least, using > <!--#echo encoding="none" var="..." > would be the correct use, surely? That doesn’t work, though, when the variable may contain <>&".
Created attachment 24464 [details] Testcase that shows the problem, SSI has to be enabled!
I would like to confirm this problem. See my attached SSI file for an example.
Fixed on trunk in r998651.