Installation guide
Internationalization Information
57
If a servlet uses the ServletRequest.getParameter method to retrieve values in form fields
having something other than a supported Java character encoding, the
parameterEncoding
property must be set to
auto (the default) in the contexts.properties file. Otherwise, the values
extracted by the
getParameter method are zeros or are undefined.
Because the original encoding used to enter data into form fields is lost when the data is
URL-encoded, you must do the following:
auto (Default) Tries to figure out the proper encoding from the charset if it is set in the
Content-Type header. Otherwise, the system default encoding is used. Set this
option to prevent misinterpretation of non-ASCII characters in servlet parameters.
When this property is set to auto, the server has to convert native characters into a
java byte array before transforming them into the requested encoding. Therefore,
performance is slightly better for a supported java character encoding or none.
If this option is specified, the servlet container looks for some hints for the character
encoding to be used. The hint can be specified in two ways:
1.
As a request attribute. The servlet developer can set the request
attribute using the name:
"com.iplanet.server.http.servlet.parameterEncoding"
The value is of type String. Note that the request attribute needs to be
set before any calls to
getParameter() or getParameterValues().
Example:
request.setAttribute("com.iplanet.server.http.servlet.para
meterEncoding"
"Shift_JIS");
request.getParameter("test");
This option is used if the servlet that is reading the data knows
beforehand what the charset of the posted data is.
2. As a j_encoding parameter in the form data . The form that is being
submitted can have a hidden element :
<input type=hidden name="j_encoding" value="Shift_JIS" >
This option is typically used if the sevlet that is reading the data does
not necessarily know what the charset of the posted data is.
Table 5 parameterEncoding Options
Option Description