乱码改不了,心好累啊,怎么办
浏览器的编码方式调节为utf-8,以chrome浏览器为例,右上角—>更多工具->编码->utf-8
可能是文本本身没有以utf-8编码,以notepad++为例,格式->转换成utf-8编码
<html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <head> <title> 这是标题 </title> <meta name = "Generator" content = "EditPlus"> <meta name = "Author" content = ""> <meta name = "Keywords" content = ""> <meta name = "Description" content = ""> </head> <body> <h1>测试网页abc</h1> </body> </html>
搞定了,jsp文件顶部加上<%@page pageEncoding="utf-8"%>即可
我用的linux系统,文本也是utf8的,但是中文死活乱码,chrome也没找到设置的地方