I'm using a PrintWriter to write a String into a file. So far so good. However, now I'm trying to make an encryption program and I noticed that some numbers just don't go well.
For example: if a char after encryption has the integer value of 157 then if I write a String containing that char to a .txt file and then read it in again then it will have changed to 63...
Same things happen for several values such as 137 for example (which also becomes 63). Why is this happening and how can I avoid it?
It's making my decryption give me faulty results in the case of those characters however the problem only appears when I save to a file and load it again before decrypting it. The decryption works perfectly if I use it on the String without first writing it to a file.