FCKeditor(java版) for 获取文本框数值中文出现乱码,怎么解决

来源:百度知道 编辑:UC知道 时间:2024/05/31 09:04:56
FCKeditor(java版) 获取文本框数值中文出现乱码,怎么解决?
/*开发环境 window xp
**MyEclipse4.2+Struts+Hibernate+Tomcat5.0
**
**/
最近琢磨点文本编辑器
A.jsp代码如下
<%@ page language="java"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="com.fredck.FCKeditor.*"%>
<%
request.setCharacterEncoding("GBK");
%>
<HTML>
<FORM action="B.jsp" mothed="post">
<%@ taglib uri="http://fckeditor.net/tags-fckeditor" refix="FCK"%>
<FCK:editor id="txtDescription" basePath="/BBS/FCKeditor/"height="400"

</FCK:editor>

<input type="submit">
</FORM>
</HTML>
/**************************************/
B.jsp 代码如下
%@ page language="

除了加过滤器之外,不要做其他的转换(这里指的转换是指 new String(str.getBytes("IS0-8859-1"),"GBK") ),修改一下 tomcat 的server.xml中的:

<Connector URIEncoding="GBK" useBodyEncodingForURI="true" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" port="8080" redirectPort="8443" >
</Connector>

关键是要加上 :URIEncoding="GBK" useBodyEncodingForURI="true"
这两个属性,其他属性保持原样即可。

楼主的问题太深奥.
- -!

好长时间没看过jsp了,不过好象遇到过这样的问题.最后在一本书上得到了答案!今天回家帮你看看啊!

不会啊