简体   繁体   English

Netbeans文件无法安全打开

[英]Netbeans file cannot be safely opened

I get files from friend who don't use netbeans IDE, when i open file that contain special caracter like 'é','à',... it show me this popup message : 我从不使用netbeans IDE的朋友那里获取文件,当我打开包含特殊字符的文件时,例如'é','à',...它显示了这个弹出消息: 这个弹出消息

if i say yes it open the file and changes those caracters to ' ' like 如果我说是,则打开文件并将这些字符更改为' ' 这个 or 要么 这个

Any idea how to open the file safely? 知道如何安全地打开文件吗?

The letters you are mentioning seem to be French. 你提到的信件似乎是法国人。 You need to open the file, specifying the original encoding, then save the file as UTF-8 您需要打开文件,指定原始编码,然后将文件保存为UTF-8

I recently encountered a very similar problem (I have some javascript files in Chinese which translated into similar non-human readable text upon re-opening the file in NetBeans). 我最近遇到了一个非常类似的问题(我有一些中文的javascript文件,在NetBeans中重新打开文件时会翻译成类似的非人类可读文本)。

My OS: Linux Mint (version 17, Cinnamon; Notepad++ not available and gedit did not solve the problem). 我的操作系统:Linux Mint(版本17,Cinnamon; Notepad ++不可用,gedit没有解决问题)。

Netbeans Version: 8.0.1 Netbeans版本:8.0.1

However, I was blessed to have found the history feature! 但是,我很幸运能找到历史功能! I was able to get a former version of my file restored and backed it up immediately . 我能够恢复我的文件的旧版本并立即备份

To access a file's history simply click on the History button found on the left side of the tool bar between the tabs of open files at the top of the IDE and the actual source code. 要访问文件的历史记录,只需单击工具栏左侧的“历史记录”按钮 ,即IDE顶部打开文件的选项卡和实际源代码之间。 (You can also right click on the file name and selected History -> Show History ). (您也可以右键单击文件名并选择历史记录 - >显示历史记录 )。 Then Double click on a *Timestamp representing a valid version of your file. 然后双击表示文件有效版本的*时间戳。 Just below the table of Timestamps the old 'backup' file and the current 'corrupted' file should appear side-by-side. 在时间戳表下方,旧的“备份”文件和当前“已损坏”的文件应并排显示。 (You can preview several historical versions of the file until you find one that works best for you; of course, when choosing a file I suggest one which is still usable and has the most current Timestamp associated with it!) ). (您可以预览该文件的多个历史版本,直到找到最适合您的文件;当然,在选择文件时,我建议使用一个仍可使用并且具有与之关联的最新时间戳的文件!))。 Right click again on the 'backup' version of your choice -> Revert from History. 再次右键单击您选择的“备份”版本 - >从历史记录恢复。 Click back on the Source button found right next to the History button. 单击“历史记录”按钮旁边的“源”按钮,然后单击该按钮。

Finally, to change the default encoding, I applied the fix suggested by Sebas and Danny here: How to change file encoding in NetBeans? 最后,为了更改默认编码,我在这里应用了Sebas和Danny建议的修复: 如何在NetBeans中更改文件编码? Please note that the path to the netbeans.conf file is different (at least with version 8.0.1 on my Linux machine). 请注意,netbeans.conf文件的路径是不同的(至少在我的Linux机器上是8.0.1版本)。 The path on my machine was : ~/netbeans-8.0.1/etc/netbeans.conf. 我机器上的路径是: 〜/ netbeans-8.0.1 / etc / netbeans.conf。

This saved the day for me and I hope it helps someone else out there! 这为我节省了一天,我希望它可以帮助其他人! Bonne chance. Bonne的机会。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM