有JSP页面向Oracle数据库提交数据中文乱码
JSP页面向oracle数据库插入中文乱码jsp页面的编码格式是utf-8<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>oracle数据库的默认编码格式:gb2312tomcat的默认编码格式:IOS-8859-1页面向数据库中插入数据出现乱码。但是在oracle数据库中用insert语句直接插入中文,显示正常。解决方法:将request得到的数据,进行重新编码 username = new String(username.getBytes("iso-8859-1"),"utf-8");
页:
[1]