close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_fs.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
- Timestamp:
-
Oct 18, 2011, 3:57:27 PM (14 years ago)
- Author:
-
waue
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v2
|
v3
|
|
6 | 6 | |
7 | 7 | |
8 | | 1、windows->Preferences...打開"首選項"對話框,左側導航樹,導航到general->Workspace,右側Text file encoding,選擇Other,改變為UTF-8,以後新建立工程其屬性對話框中的Text file encoding即為UTF-8。 |
| 8 | = 1. = |
| 9 | windows->Preferences...打開"首選項"對話框,左側導航樹,導航到general->Workspace,右側Text file encoding,選擇Other,改變為UTF-8,以後新建立工程其屬性對話框中的Text file encoding即為UTF-8。 |
9 | 10 | |
10 | | 2、windows->Preferences...打開"首選項"對話框,左側導航樹,導航到general->Content Types,右側Context Types樹,點開Text中每一顆子項,並在中輸入"UTF-8",點update! |
| 11 | = 2. = |
| 12 | windows->Preferences...打開"首選項"對話框,左側導航樹,導航到general->Content Types,右側Context Types樹,點開Text中每一顆子項,並在中輸入"UTF-8",點update! |
11 | 13 | |
12 | | 其他java應用開發相關的文件如:properties、XML等已經由Eclipse缺省指定,分別為ISO8859-1,UTF-8,如開發中確需改變編碼格式則可以在此指定。 |
| 14 | = 3. = |
| 15 | Servers -> TomcatXXXX-config : server.xml |
| 16 | {{{ |
| 17 | <Connector port="7080" protocol="HTTP/1.1" |
| 18 | connectionTimeout="20000" |
| 19 | redirectPort="7443" |
| 20 | URIEncoding="UTF-8" useBodyEncodingForURI="true"/> |
| 21 | }}} |
13 | 22 | |
14 | | |
15 | | 3、經過上述三步,新建java文件即為UTF-8編碼,Eclipse編譯、運行、調試都沒問題,但是做RCP應用的Product輸出時、或者插件輸出時,則總是出錯,要麼不能編譯通過(輸出時要重新compile)、要麼輸出的插件運行時中文顯示亂碼。此時需要再RCP應用、或插件Plugin工程的build.properties中增加一行,javacDefaultEncoding.. = UTF-8。讓輸出時編譯知道java源文件時UTF-8編碼。這個設置需要保證所有的java源文件時UTF-8編碼格式,如果不全是,可以參考 Eclipse幫中(Plug-in Development Environment Guide > Reference > Feature and Plug-in Build configuration),建議全部java源文件是UTF-8編碼。 |
| 23 | 這邊的選項是在eclipse 建立 tomcat 時就已經載入了,因此即使之後在改 原始目錄的 server.xml 也不會對應到 eclipse ,因此可以到專案內修改。 |