Issue

When you submit a form with UTF-8 character input (not in the ISO-8859-1 charset) and the form output is written, the server outputs the wrong characters.

Solution

Set the content type to use UTF-8 encoding. For example:

<%@taglib uri="/libs/CFC/resources/jstl/c.tld" prefix="c" %> <form method="post"> <input name="searchterm" value="<c:out value="${param.searchterm}" />" /><input type="submit" /> </form>

Example:

When the user inserts "ä" (a-Umlaut) in a form field (input box) and clicks Submit, the input box shows "�" after the JSTL roundtrip.

The same sample JSP page works fine in other servlet engines.

Expected result:

The input box should show "ä" (a-Umlaut).

Example solution:

<%@ page contentType="text/html;encoding=UTF-8" %> <%@ taglib uri="/libs/CFC/resources/jstl/c.tld" prefix="c" %> <form method="post"> <input name="searchterm" value="<c:out value="${param.searchterm}" />" /><input type="submit" /> </form>

Additional information

This issue occurs when the default encoding in CQ Servlet Engine is ISO-8859-1.

Za ta izdelek je bila izdana neprenosljiva licenca za priznanje avtorstva, nekomercialno uporabo in skupno rabo pod enakimi pogoji 3.0  Objav v storitvah Twitter™ in Facebook ne urejajo pogoji pogodbe Creative Commons.

Pravna obvestila   |   Pravilnik o zasebnosti v spletu