由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Eclipse不能保存UTF-8文件?
相关主题
请问用eclipse开发中文的软件JSP for the ASP Developer
问个xml的问题JSP技术简介 [fwd]
菜鸟请教版上大虾--如何用Java建一个连接Dababase的Tomcat网页PHP vs ASP vs JSP
[合集] Are JSPs Dead?JavaServer Pages入门篇
请教汉字的utf-8 mapping (转载)几种流行的动态网页制作语言的比较
怎麼得到字符串中的raw bytes?The Problems With JSP
How to scroll an JInternalFrame使用JAVA的一则经验和教训
Re: 一个最近完成的JAVA项目的反思。水母关于jsp的讨论
相关话题的讨论汇总
话题: utf话题: jsp话题: encoding话题: bom话题: properties
进入Java版参与讨论
1 (共1页)
k***r
发帖数: 4260
1
I saved a JSP file with an external text editor (Notepad++)
as UTF-8 with BOM. Eclipse reads it fine after I set in
project properties, resource, source file encoding as UTF-8.
However, when I try to save, I get an error:
"Save could not be completed.
Reason:
Some characters cannot be mapped using "ISO-8859-1" charater
encoding ..."
Any idea how I can save JSP in UTF-8?
g*****g
发帖数: 34805
2
right click file, choose encoding as UTF-8

【在 k***r 的大作中提到】
: I saved a JSP file with an external text editor (Notepad++)
: as UTF-8 with BOM. Eclipse reads it fine after I set in
: project properties, resource, source file encoding as UTF-8.
: However, when I try to save, I get an error:
: "Save could not be completed.
: Reason:
: Some characters cannot be mapped using "ISO-8859-1" charater
: encoding ..."
: Any idea how I can save JSP in UTF-8?

k***r
发帖数: 4260
3
什么版本啊?我的是3.5.2,right click in editor shows no
such menu ...

【在 g*****g 的大作中提到】
: right click file, choose encoding as UTF-8
g*****g
发帖数: 34805
4
choose properties->resource.

【在 k***r 的大作中提到】
: 什么版本啊?我的是3.5.2,right click in editor shows no
: such menu ...

k***r
发帖数: 4260
5
Project properties? 这个试过了,设成UTF-8之后可以读UTF-8文件,
不能保存。。。

【在 g*****g 的大作中提到】
: choose properties->resource.
g*****g
发帖数: 34805
6
Properties for individual file

【在 k***r 的大作中提到】
: Project properties? 这个试过了,设成UTF-8之后可以读UTF-8文件,
: 不能保存。。。

k***r
发帖数: 4260
7
Properties里面没有encoding。。。
菜单Set Encoding里面default是determined from content,
已经是UTF-8了,但是不管用。手工选择 UTF-8就可以了。
谢谢!

【在 g*****g 的大作中提到】
: Properties for individual file
m******t
发帖数: 2416
8
If you are on windows, I would recommend always set the encoding to utf-8 at
the workspace level.

【在 k***r 的大作中提到】
: Properties里面没有encoding。。。
: 菜单Set Encoding里面default是determined from content,
: 已经是UTF-8了,但是不管用。手工选择 UTF-8就可以了。
: 谢谢!

b******y
发帖数: 9224
9
I use notepad++, great product.
Except the guy hates China I guess, but what da heck, I just use it as it is
free anyway.
UTF-8 is easy, I either use UTF-8 with BOM or not.
k***r
发帖数: 4260
10
Good idea! Thanks

8 at

【在 m******t 的大作中提到】
: If you are on windows, I would recommend always set the encoding to utf-8 at
: the workspace level.

k***r
发帖数: 4260
11
I find that if jsp is UTF-8 w/o BOM, the page is not
rendered property. Not sure if tomcat determines page
encoding from BOM and sends a wrong header. So I have
to always use UTF-8 with BOM.

it is

【在 b******y 的大作中提到】
: I use notepad++, great product.
: Except the guy hates China I guess, but what da heck, I just use it as it is
: free anyway.
: UTF-8 is easy, I either use UTF-8 with BOM or not.

g*****g
发帖数: 34805
12
I don't get why you need UTF-8 with JSP though, those
resource entries are better saved in resource files.

【在 k***r 的大作中提到】
: I find that if jsp is UTF-8 w/o BOM, the page is not
: rendered property. Not sure if tomcat determines page
: encoding from BOM and sends a wrong header. So I have
: to always use UTF-8 with BOM.
:
: it is

k***r
发帖数: 4260
13
I'm taking a shortcut and hard-coding some text
strings in the JSP files :-)
I think JSPs are HTML files with Java. It's a little
extreme to exclude any text strings in JSP for single
language pages. Even for multiple language pages, I'm
not sure if it's always practical to use templates in
JSPs to form sensible text.

【在 g*****g 的大作中提到】
: I don't get why you need UTF-8 with JSP though, those
: resource entries are better saved in resource files.

m******t
发帖数: 2416
14

Hey, I think I like my Chinese CSS style names just fine! ;-)

【在 g*****g 的大作中提到】
: I don't get why you need UTF-8 with JSP though, those
: resource entries are better saved in resource files.

1 (共1页)
进入Java版参与讨论
相关主题
水母关于jsp的讨论请教汉字的utf-8 mapping (转载)
jBuiler 4白皮书(来自inprise网站)怎麼得到字符串中的raw bytes?
Re: Can I use JSP on server and use Applet as user interface on clientHow to scroll an JInternalFrame
new in JSP 2.0 specRe: 一个最近完成的JAVA项目的反思。
请问用eclipse开发中文的软件JSP for the ASP Developer
问个xml的问题JSP技术简介 [fwd]
菜鸟请教版上大虾--如何用Java建一个连接Dababase的Tomcat网页PHP vs ASP vs JSP
[合集] Are JSPs Dead?JavaServer Pages入门篇
相关话题的讨论汇总
话题: utf话题: jsp话题: encoding话题: bom话题: properties