Share |
Back to frequently asked questions

When forms are submitted, special characters are messed up.

This problem can have several reasons. Generally you should always use the following guidelines when submitting forms.
ALWAYS use post, forms posted as get, will mess up special characters.
Specify the encoding of the parameters, on the receiving page. In Java this is done by using the following line, before starting to read the parameters:
request.setCharacterEncoding("UTF-8");
Almost all languages has similar ways of setting the encoding.
Always set the encoding on the page, which post's the parameters. This can be done with a simple meta tag. Normally something similar to:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
This can also be done server side. In java, by using the line:
response.setContentType("text/html; charset=utf-8");