• Eclipse编码设置


    网站代码主要使用GBK编码格式,Eclipse默认打开的是UTF8编码,所以经常是需要进行转换一下的,否则一些中文字符就会乱码显示。

    1.配置workspace的编码格式:windows->Preferences->general->Workspace,右侧Text file encoding,选择Other,改变为GBK;
    2.配置工程的编码格式:Project->Preferences->Resource->Text file encoding;
    3.配置java文件的编码格式:windows->Preferences->general->ContentTypes->Java Source File->UTF-8 ==Update;
    4. 做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编码。

    1.在eclipse.ini的-vmargs下面加上「-Dfile.encoding=UTF-8」。

    2.eclipse-->Window-->Preferences-->General-->Workspace-->Text file encoding-->UTF-8

    3.Installed JREs-->Default VM Arguments:-->-Dfile.encoding=UTF-8

    4.eclipse-->Run-->Run Configurations-->Arguments-->VM arguments-->-Dfile.encoding=UTF-8

    5.eclipse-->Run-->Run Configuration-->Common 頁籤--> Console Encoding-->Others-->UTF-8

    ==>亂碼!

    5.eclipse-->Run-->Run Configuration-->Common 頁籤--> Console Encoding-->Others-->big5

    ==>ok!
    参考资料:
    http://eggboss.iteye.com/blog/639841

  • 相关阅读:
    Vue插件配置和 后台交互
    Vue项目环境搭建
    数据结构之链表
    数据结构之线性表顺序结构
    leetcode-- Longest Common Prefix
    数据结构之拓扑排序
    数据结构之shell排序
    数据结构之插入排序
    leetcode
    leetcode
  • 原文地址:https://www.cnblogs.com/xuelu/p/3806631.html
Copyright © 2020-2023  润新知