title: How to convert accented characters in Java
body: <p>I'm using Java 1.5 and I need to normalize a String
  (like this <code>àèìòù</code> ---> <code>aeiou</code>). I can't use Normalizer because is for > 1.6 
  Any ideas?</p>
  
  <p>I've tried this:</p>
  
  <pre><code>public String normalizeText(String text) {
      text = normalizer(text);
      text = text.replaceAll("\\p{InCombiningDiacriticalMarks}]", "");
      return text;
  }
  
  public static String normalizer(String word) {
      try {
          int i;
          Class&lt;?&gt; normalizerClass = Class.forName("java.text.Normalizer");
          Class&lt;?&gt; normalizerFormClass = null;
          Class&lt;?&gt;[] nestedClasses = normalizerClass.getDeclaredClasses();
          for (i = 0; i &lt; nestedClasses.length; i++) {
              Class&lt;?&gt; nestedClass = nestedClasses[i];
              if (nestedClass.getName().equals("java.text.Normalizer$Form")) {
                  normalizerFormClass = nestedClass;
              }
          }
          assert normalizerFormClass.isEnum();
          Method methodNormalize = normalizerClass.getDeclaredMethod(
                  "normalize",
                  CharSequence.class,
                  normalizerFormClass);
          Object nfcNormalization = null;
          Object[] constants = normalizerFormClass.getEnumConstants();
          for (i = 0; i &lt; constants.length; i++) {
              Object constant = constants[i];
              if (constant.toString().equals("NFC")) {
                  nfcNormalization = constant;
              }
          }
          return (String) methodNormalize.invoke(null, word, nfcNormalization);
      } catch (Exception ex) { return null; }
  }
  </code></pre>