code: public static int replaceAccentedChars(StringBuilder buffer) {
          // save the size before we strip out the accents
          int sizeBefore = buffer.length();
          // each accented char will be converted into 2 chars -- the ascii version
          // followed by the accent character
          String s = Normalizer.normalize(buffer, Normalizer.Form.NFD);
          // new size will include accented chars
          int sizeAfter = s.length();
          // efficiency check #1 - if the length hasn't changed, do nothing
          int replaced = sizeAfter - sizeBefore;
          if (replaced <= 0) {
              return 0;
          }
  
          // replace the accents with nothing
          s = s.replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
          buffer.setLength(0);
          buffer.append(s);
          
          return replaced;
      }
docs: Replace accented characters with their ascii equivalents.  For example,
  convert é to e.<br><br>
  NOTE: This method is not very efficient.  The String will be copied
  twice during conversion, so you'll likely only want to run this against
  small strings.
  
  @param buffer The buffer containing the characters to analyze and replace
  if necessary.
  @return The number of characters replaced