title: sorting an array with special characters (german Umlaute) in GWT
body: <p>I'm working on a GWT 2.6.1 project receiving data from a MySQL database.</p>
  
  <p>All working fine but I have a problem with the öäüÖÄÜß (special chars) from the German language.</p>
  
  <pre><code>public void onSuccess(RPCObjectStringArray result) {
      String[] resultArray = result.getStringarray();
      Arrays.sort(resultArray,new ComparenoCaseUmlaut());
      for (int i = 0; i &lt; resultArray.length; i++) {
          System.out.println(result[i]);
      }
  }
  
  public class ComparenoCaseUmlaut implements Comparator&lt;String&gt; {
  
      @Override
      public int compare(String arg0, String arg1) {
          Collator collator = Collator.getInstance(Locale.GERMAN);    
          collator.setStrength(Collator.SECONDARY); // non case sensitive                 
          return collator.compare(arg0,arg1);
      }
  
  }
  </code></pre>
  
  <p>But this can't work while GWT doesn't support the collator lib.</p>
  
  <p>So - I tried this (to make it easy to follow - I've changed the resultArray to an example):</p>
  
  <pre><code>String[] resultArray = { "Abc", "öbc", "BBC", "the", "abd", "X"};
  
  public class ComparenoCaseUmlaut implements Comparator&lt;String&gt; {
  
  @Override
  public int compare(String arg0, String arg1) {
  
      String string0 = arg0.toLowerCase();
      String string1 = arg1.toLowerCase();
      string0.replace("ä", "a");
      string0.replace("ö", "o");
      string0.replace("ü", "u");
      string0.replace("ß", "s");
      string1.replace("ä", "a");
      string1.replace("ö", "o");
      string1.replace("ü", "u");
      string1.replace("ß", "s");
      return string0.compareTo(string1);
  }
  </code></pre>
  
  <p>The result:<br>
   "Abc"
   "abd"
   "BBC"
   "the"
   "X"
   "öbc"</p>
  
  <p>I've debugged that the .replace function doesn't act as expected. It can't replace the "ö" char - cause he couldn't find it. A compare with "==" the same...</p>
  
  <p>I've changed the charset in my eclipse project to UTF-8 - nothing changed.</p>
  
  <p>I'm new to java (for about a couple of months and also to GWT but an oldie in programming), so please give me some details - or a link... I could study by myself and bring the result back here. But at the moment I don't know were I have to begin....</p>
  
  <p>I read something about plugins for eclipse and the GWT Internationalization but it sounds too high to understand. Otherwise I would learn it - but would it be helpfully?</p>