title: Why is text in Swedish from a resource bundle showing up as gibberish?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4659929/how-to-use-utf-8-in-resource-properties-with-resourcebundle">How to use UTF-8 in resource properties with ResourceBundle</a>  </p>
  </blockquote>
  
  
  
  <p>I want to allow internationalization to my Java Swing application. I use a bundle file to keep all labels inside it.</p>
  
  <p>As a test I tried to set a Swedish title to a <code>JButton</code>. So in the bundle file I wrote:</p>
  
  <pre><code>nextStepButton=nästa
  </code></pre>
  
  <p>And in the Java code I wrote:</p>
  
  <pre><code>nextStepButton.setText(bundle.getString("nextStepButton"));
  </code></pre>
  
  <p>But the title characters of the button appear wrong at runtime:<br>
  <img src="https://i.stack.imgur.com/dZjHL.jpg" alt="alt text"></p>
  
  <p>I am using the Tahoma font, which supports Unicode.
  When I set the button title manually through code it appears fine:</p>
  
  <pre><code>nextStepButton.setText("nästa");
  </code></pre>
  
  <p><strong>Any idea why it fails in bundle file ?</strong></p>
  
  <p>--------------------------------------------> <strong>Edit: Encoding the title:</strong><br>
  I have tried encoding the text coming from the bundle file using the code:</p>
  
  <pre><code>nextStepButton.setText(new String(bundle.getString("nextStepButton").getBytes("UTF-8")));
  </code></pre>
  
  <p>And still the result is:<br>
  <img src="https://i.stack.imgur.com/2Wfmc.jpg" alt="alt text"></p>