class BundleNormalizer {

  protected static String normalize(String s) {
    Require.nonNull(s, "parameter s may not be null or empty.");

    // first replace umlauts with two-characters
    s= replaceUmlauts(s);

    // then replace some special characters
    s= s.replaceAll("[\\ \\.\\-\n/]+", "_");

    // then remove all diacritics and all characters not US_ASCII or numbers
    s= Normalizer
            .normalize(s, Normalizer.Form.NFKD)
            .replaceAll("[^\\P{M}]", "")
            .replaceAll("[^\\p{Alnum}\\_\\-\\ ]", "");

    // then replace multiple underscores with only one underscore
    s= s.replaceAll("[_]+", "_");

    // remove all leading and trailing underscores
    s= s.replaceAll("^_", "").replaceAll("_$", "");

    return s;
  }

}