Weird characters appear after write to a file
807607Jan 3 2007 — edited Jan 5 2007Here is my story:
I open a file using RandomAccessFile to replace some characters inside it. Let's say I have in the file string 4000, I replace it by string 400. It works fine.
Now if I replace this number by string 40000, when I check the text file, some weird characters like ^M appear everywhere at the end of lines.
What's the reason and how to solve it? I believe there is some invisible characters at the end of string 4000 that causes the problem.
Note that I use function writeBytes to write strings into the file.