1
4

4 回答 4

0

I'm assuming that you are sending POST parameters.

I think that the most likely cause of your initial problem is one of the following:

  1. If the parameters are being sent in the HTTP request body, your Perl front-end is probably not setting the encoding in the content type header of the request. The webserver is probably to assuming ISO-8859-1. The solution to this is to set the request content type properly.

  2. If the parameters are sent in the HTTP request URL, your web server is using the wrong characterset when decoding the request parameters. The solution to this is going be web-server specific ...

It sounds like there might also be a character set problem in talking to the database, but that might just be a consequence of earlier mangling.

于 2012-06-05T06:06:31.700 回答
0
于 2012-06-05T06:02:57.933 回答
0

使用来自Apache Commons Lang的StringEscapeUtils

import static org.apache.commons.lang.StringEscapeUtils.escapeHtml;
// ...
String source = "The less than sign (<) and ampersand (&) must be escaped before using them in HTML";
String escaped = escapeHtml(source);
于 2012-06-05T05:19:41.980 回答
0

我们在其中一个项目中也遇到过类似的问题。所以我们不得不编写一个小程序来将这些utf8字符转换为html encoded并存储到数据库中。

于 2012-06-05T05:14:24.943 回答