source code里的中文注释全变成乱码了, 我哭......谁知道怎么把中文恢复回来啊?

XMCon 2014-07-31 08:31:13
sun.misc.BASE64Encoder找不到jar包,我就在project build path中先移除JRE System Library,再添加库JRE System Library,重新编译后, sun.misc.BASE64Encoder倒是好了, 可是我那些source code里的中文注释全变成乱码了, 我哭......哪位高人知道怎么把中文恢复回来啊?
...全文
725 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
S117 2014-08-01
  • 打赏
  • 举报
回复
引用 11 楼 XMCon 的回复:
[quote=引用 7 楼 longtian1213 的回复:] 你没备份库吗
用文本编辑器直接找开代码文件, 中文字符是正常的. 只是在ECLIPSE里显示时变成了乱码.[/quote] 编码不同,用记事本打开,然后另存为utf-8格式,看下还会乱码不了
markcxz 2014-08-01
  • 打赏
  • 举报
回复
用记事本打开一个出乱码的代码文件,另存一下,看看编码那里是什么?

选择“UTF-8”保存一下,替换掉原来的代码文件,再用eclipse打开看看(确保workspace的编码设置为UTF-8)。
XMCon 2014-08-01
  • 打赏
  • 举报
回复
引用 7 楼 longtian1213 的回复:
你没备份库吗
用文本编辑器直接找开代码文件, 中文字符是正常的. 只是在ECLIPSE里显示时变成了乱码.
XMCon 2014-08-01
  • 打赏
  • 举报
回复
引用 6 楼 rui888 的回复:
你以前编码什么?
UTF-8
XMCon 2014-08-01
  • 打赏
  • 举报
回复
引用 5 楼 markcxz 的回复:
使用文本编辑器直接打开代码文件,看看是否正常
用文本编辑器直接找开代码文件, 中文字符是正常的. 只是在ECLIPSE里显示时变成了乱码.
S117 2014-08-01
  • 打赏
  • 举报
回复
你没备份库吗
tony4geek 2014-08-01
  • 打赏
  • 举报
回复
你以前编码什么?
markcxz 2014-08-01
  • 打赏
  • 举报
回复
使用文本编辑器直接打开代码文件,看看是否正常
七脉 2014-08-01
  • 打赏
  • 举报
回复
引用 9 楼 XMCon 的回复:
[quote=引用 5 楼 markcxz 的回复:]
使用文本编辑器直接打开代码文件,看看是否正常


用文本编辑器直接找开代码文件, 中文字符是正常的. 只是在ECLIPSE里显示时变成了乱码.[/quote]
既然用文本编辑打开不乱码,先复制粘贴到java类中用;
我平时设置乱码是 window---->preferences---->搜workspace然后你看下就明白
悠忧虫 2014-08-01
  • 打赏
  • 举报
回复
两种方式: 1. 在eclipse里面将项目编码修改成gbk试试 2. 用notepad++打开源文件,格式-->转为utf-8无BOM格式编码
S117 2014-08-01
  • 打赏
  • 举报
回复
引用 14 楼 XMCon 的回复:
[quote=引用 13 楼 longtian1213 的回复:] [quote=引用 11 楼 XMCon 的回复:] [quote=引用 7 楼 longtian1213 的回复:] 你没备份库吗
用文本编辑器直接找开代码文件, 中文字符是正常的. 只是在ECLIPSE里显示时变成了乱码.[/quote] 编码不同,用记事本打开,然后另存为utf-8格式,看下还会乱码不了[/quote] 果然这样就好了, 可是这样要一个一个文件另存, 有什么简便的方法吗?[/quote] 我也没想到还有什么更好的办法
XMCon 2014-08-01
  • 打赏
  • 举报
回复
引用 13 楼 longtian1213 的回复:
[quote=引用 11 楼 XMCon 的回复:] [quote=引用 7 楼 longtian1213 的回复:] 你没备份库吗
用文本编辑器直接找开代码文件, 中文字符是正常的. 只是在ECLIPSE里显示时变成了乱码.[/quote] 编码不同,用记事本打开,然后另存为utf-8格式,看下还会乱码不了[/quote] 果然这样就好了, 可是这样要一个一个文件另存, 有什么简便的方法吗?
XMCon 2014-07-31
  • 打赏
  • 举报
回复
引用 3 楼 sunlotus0 的回复:
在项目或源文件上右击-->Properties
试了, 是这个样子滴: public static void main(String[] args) throws Exception { //read input ��������; write output ������� //read write ���ַ���; input output���ֽ��� //�ַ�����һ���ַ�һ���ַ����; �ֽ�����һ���ֽ�һ���ֽڶ���. //1�ַ�=2�ֽ�. һ��������ռ�õ���2�ֽ�,�������ֽ�����д����ʱ, ����������.
悠忧虫 2014-07-31
  • 打赏
  • 举报
回复
在项目或源文件上右击-->Properties

XMCon 2014-07-31
  • 打赏
  • 举报
回复
引用 1 楼 shixitong 的回复:
从新设置source的编码试试
弱弱地问一下: 怎么设啊?
shixitong 2014-07-31
  • 打赏
  • 举报
回复
从新设置source的编码试试
Build 1632
requires software maintenance through 2008.04.03. (Beta release.)
New! Added context-sensitive help to VA X dialogs. Click ? or press F1 to get help. (case=8980)
New! Visual Studio 2008-style transparent listboxes are available in all IDEs. Hold down Ctrl when listbox is displayed to activate. (case=10072) 7209, 6972
New! Added option to include or exclude refactoring suggestions in listboxes; see Advanced | Refactoring | Include refactoring suggestions in listboxes. (case=10428) 5797, 7254
"return" takes precedence over "RETCODE" in suggestion lists. (case=11277) 7036
Fixed incompatibility with XNA Game Studio 2.0. (case=10703) 7064
Restored "put n spaces between method name and ()" option under Advanced | Corrections. (case=10995) 7304
Fixed a problem typing "else" on a line by itself. (case=8415)
Debugger tooltips display without flickering. (case=8817) 6647
Fixed hang when opening web site project in Visual Studio 2008. (case=10401)
Fixed intermittent crash when typing a VB Imports statement in Visual Studio 2008 on Windows Vista. (case=15154)
Ctrl+Tab document switching is handled properly in Visual Studio 2008. (case=10303) 7010
Visual Studio 2008 C++ include directories that contain double backslashes due to environment variable expansion are located and parsed correctly. (case=11261)
Highlight current line works properly in .js and .asp/.aspx files in Visual Studio 2008. (case=15384)
Visual Basic enumerations are parsed correctly. (case=12161)
Removed C-style comment and semicolon from Encapsulate Field in Visual Basic files. (case=11160, case=4475) 7107
Object methods called on boxed string literals in C# are parsed correctly. (case=8012) 6513
Subsequent rename operations issued from VA Outline target the correct symbol. (case=10502) 7039
MFC dispatch map is shown in VA Outline. (case=10514)
Tooltips are positioned correctly when VA Outline is undocked in VC6. (case=9976) 6946
VA Outline shows correct hierarchy for C++ classes containing friend methods without friend class declaration. (case=10740) 7072
.Net symbols are excluded from suggestion lists in unmanaged C++ solutions. (case=11391) 7148
Fixed Extract Method with for each loop in managed C++. (case=14864) 7348
Typing a dot after a C++ constructor invocation [ e.g. std::string("some text"). ] displays member list properly. (case=9876)
C++ using declarations (using namespace::identifier) are parsed correctly. (case=9436)
STL list<> and vector<> member lists appear correctly following a "using namespace std::list" or "using namespace std::vector" directive. (case=12345) 7226
Empty C++ preprocessor directives are ignored (fixes problem parsing Boost library). (case=10353)
Typedefs declared inside template classes are parsed correctly. (case=12098)
Improved parsing of STL iterator patterns (case=11842) 7136, 7202, 7212
Improved stability when parsing deep templates. (case=15454)
Fixed dereferenced iterators missing from Find References / Rename. (case=1702) 6451, 4978
Cloned Find References windows are not hidden behind the VC6 IDE. (case=10201) 7000, 7026
IDE warning message about writing to a read-only file is brought to the foreground during a rename operation if applicable. (case=8958)
#include paths are preserved when typing a slash with Repair Case disabled. (case=12025) 7200
C# generic methods are colored properly. (case=9300) 6801
Comments in tooltips and views use IDE comment color. (case=9363) 6904, 6808
Dialog edit controls are colored properly in Windows Vista. (case=9281)
Filenames displayed in lists and views are not syntax colored. (case=12556, case=12788)
Foreground text color is automatically changed if it matches the background color. (case=14268)
VA View Symbols in Solution list items are colored properly. (case=14899)
Quick Info and Parameter Tooltips invoked via the keyboard are colored properly. (case=3082) 5462
Goto (Alt+G) handles template class typedefs. (case=4249) 6168, 5774
Goto handles duplicate files better (as with VSS shared directories). (case=5567, case=7457) 6027, 6021
Listboxes are positioned such that they are not truncated at the right edge of the screen. (case=5178)
Listbox remains on the same side of a symbol (either above or below) when typing inside parentheses. (case=8998) 6672
Windows Vista visual styles are applied to listboxes. (case=9275)
Accepting a suggestion from a listbox properly replaces acronym text. (case=14290) 7316
Fixed disappearing listboxes in .js and .asax files. (case=1699, case=15295) 4843
Fixed bad icons appearing in suggestion lists. (case=14469)
#include directives listed in Find References results are displayed with question mark icons. (case=9592) 6869
Esc key turns off Highlight All when Find References results window is undocked. (case=9364) 6803
Find References error messages may optionally be displayed in the status bar instead of a modal message box. (case=10226) 7038, 6997
Spelling errors in comments with XML tags are underlined. (case=9649) 6893
XML comment suggestion list opened with < functions properly. (case=12324) 7229
Suggestions are suppressed in comments and string literals. (case=10480) 5797, 7030, 7055
Change Signature does not cause some known symbols to become unknown. (case=10432) 6762
"Enable automatic Quick Info Tooltips" option is forced on when enabling "Display comments from source files when available" option in Advanced | Display. (case=10967)
Macros in [VA X install directory]\Misc\stdafx.h are parsed each time a project is opened. (case=284)
Surround with { indents properly when selection is made from bottom to top. (case=1521) 6792, 5961, 5796, 5249
Long words (>64 chars) in comments are not underlined as mistyped. (case=3485) 5634, 5588
Improved Autosave performance. (case=9821) 6916, 5613
Open File in Solution grid lines are drawn correctly in Windows XP. (case=9948)
Forward-declared stable symbols are shown in italic. (case=399) 2263, 1934, 1912
Repair Case changes only those symbols that differ by case alone (similarly named symbols are not changed). (case=8723)
Corrected spacing around spell check replacements. (case=7768) 6471
Eliminated spurious suggestions. (case=12061) 6900
Source files residing in directories named p4win or p4v (or their descendants) are included when parsing. (case=11506) 7150
Missing VC6 toolbar icons have been restored (case=10126) 6980
Filtering toolbar shows the rightmost button correctly. (case=10623) 7044

中文注释乱码

58,453

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧