title: Java encoding issue with a txt file
body: <p>I am facing an issue while saving a text file in Java. I have coded instructions to create a file with information I want to keep in a text file. But when I want to open it, I have an error message which says that my file was loaded with the wrong encoding (UTF-8) and I can't get back the informations I want. I have tried to reload with others encoding like ISO8859-1 (which is supposed to work in most of the cases, but it didn't.</p>
  <pre><code>oos = new ObjectOutputStream(
                  new BufferedOutputStream(
                          new FileOutputStream(
                                  new File(&quot;game.txt&quot;))));
  </code></pre>
  <p>Then I create my objects, and then I get back my datas.</p>
  <pre><code>ois = new ObjectInputStream(
                  new BufferedInputStream(
                          new FileInputStream(
                                  new File(&quot;game.txt&quot;))));
  </code></pre>
  <p>I didn't find any way to solve my issue.
  Kindly help.</p>