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.
|