jsp文件中文保存时提示错误:Save could not be completed. Reason using “ISO-8859-1” character encoding

分类:编码百科| 发布:camnprbubuol| 查看: | 发表时间:2013/12/7

在MyEclipse下编程时,保存的时候,如果出现如下图所示错误:

MyEclipse中解决“Save could not be completed”问题! - 刘立 - 707903908的博客

Reason: some characters cannot be mapped using “ISO-8859-1“ character encoding. Either change the encoding or remove the characters which are not supported by the “ISO-8859-1“ character encoding.

首先说明MyEclipse的默认编译语言是"ISO-8859-1",这个语言不支持中文,所以如果编辑的程序含有中文而且编译语言是"ISO-8859-1“则就会出现这个问题!

解决方很简单,只要把默认编译语言改成支持中文的就OK了

改法如下:

window --> Preferences --> General --> Content Types --> Text --> 选中出现保存问题的文件类型(如JSP),在底部出现 'Default edcodng:',改成UTF-8或GBK(反正支持中文即可),然后点击update。
MyEclipse中解决“Save could not be completed”问题! - 刘立 - 707903908的博客

对于新建的JSP页面代码如下:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>...
把第一行最后面的ISO-8859-1改成GBK或者UTF-8

改过后,如下:

<?xml version="1.0" encoding="utf-8" ?>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>...
365据说看到好文章不转的人,服务器容易宕机
原创文章如转载,请注明:转载自郑州网建-前端开发 http://camnpr.com/
本文链接:http://camnpr.com/archives/jsp-page-save-could-not-be-completed-iso-8859-1-utf-8-gbk.html