title: read resourcebundle as UTF-8. getString() Method seems to change encoding to ISO-8859
body: <p>I have the honorable assignment to change the encoding of our complete workspace, projects and files to the UTF-8 encoding. We have several Resourcebundles which used to code special chars with unicode. We also wanted to get rid of that unicode stuff by switching to UTF-8 so I changed the encoding of the Resourcebundles (.properties) files too and replaced the Unicode characters.</p>
  
  <p>We also have german resourcebundles and some chars like </p>
  
  <blockquote>
    <p>Ä, Ö, Ü, ß. ä, ö, ü and also special characters like „ or “</p>
  </blockquote>
  
  <p>are not shown properly in the browser. Example:</p>
  
  <p>Resourcebundleentry: </p>
  
  <blockquote>
    <p>executeShellCommand.label = Shellkommando ausführen</p>
  </blockquote>
  
  <p>Result in browser:
  <img src="https://i.stack.imgur.com/w1Q06.png" alt="enter image description here"></p>
  
  <p>The resourcebundles are read with the Java.util.ResourceBundle.getString(String key) Method:</p>
  
  <pre><code>    public String getLocalizedString(ResourceBundle bundle, String key) {
      try {
          System.out.println("getLocalizedString, key: " + key + ", resourcebundle: " + bundle.getString(key));
          return bundle.getString(key);
      } catch (MissingResourceException e) {
          return key;
      }
  }
  </code></pre>
  
  <p>If i check the output of the above Sysout i get following:
  <code>getLocalizedString, key: executeShellCommand.label, resourcebundle: Shellkommando ausfÃ¼hren
  </code></p>
  
  <p>It seems that the <strong>getString(key) method changes the encoding of the chars while reading</strong> them from the bundles to the standard resourcbundleencoding(ISO-8859).</p>
  
  <p>I tried to counter this issue:</p>
  
  <pre><code>    public String getLocalizedString(ResourceBundle bundle, String key) {
      try {
          System.out.println("getLocalizedString, key: " + key + ", resourcebundle: " + new String (bundle.getString(key).getBytes(), "UTF-8"));
          return new String (bundle.getString(key).getBytes(), "UTF-8");
      } catch (MissingResourceException e) {
          return key;
      } catch (UnsupportedEncodingException e) {
          return key;
      }
  }
  </code></pre>
  
  <p>This helped to recover the most special characters but there are still a plenty of them which are not shown properly:</p>
  
  <p><img src="https://i.stack.imgur.com/85FR3.png" alt="enter image description here"></p>
  
  <p>I also checked the content-type configuration of the WebApp and of every single request which gets the resource bundles everything is utf-8.</p>
  
  <p>Does anyone have an idea how to <strong>prevent the getString()-Method from changing the encoding</strong> or is there a better way to solve this issue?</p>