简体   繁体   中英

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 : 这个弹出消息

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

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

My OS: Linux Mint (version 17, Cinnamon; Notepad++ not available and gedit did not solve the problem).

Netbeans Version: 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. (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? Please note that the path to the netbeans.conf file is different (at least with version 8.0.1 on my Linux machine). The path on my machine was : ~/netbeans-8.0.1/etc/netbeans.conf.

This saved the day for me and I hope it helps someone else out there! Bonne chance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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