I nearly completed a DES implementation for a school project when...
I ruined my source code with tar & bzip2.
The command was:
tar cjvf des.cpp des.h main.cpp > des_implementation.tar.bz2
I tried to create a compressed archive to send to a friend. To my horror, when I opened the source code in CLion (des.cpp, des.h, and main.cpp), I found that des.cpp was completely ruined and CLion was displaying an error: File was loaded in the wrong encoding: 'US-ASCII'
.
Here is a sample of the file's contents:
BZh91AY&SY©fZ�×ÿÐÞ°�ÀY÷ÿÝ¿ïßÊÿïÿê���PÞáó``Í®:D4i¢4Òz¦5=OPÞ¤iâSÚ£@õ�å
I've also tried unzipping the zipped filed, but to no avail. I thought the command would create a separate .tar.bz file and leave the originals alone?
Main questions:
- How did this happen?
- How can I make sure it never happens again?
- How can I fix this?
I am flustered and desperate, any help would be appreciated.