private static String sanitizeLanguageTag()

in locales-utils/src/main/java/com/spotify/i18n/locales/utils/languagetag/LanguageTagUtils.java [74:84]


  private static String sanitizeLanguageTag(final String languageTag) {
    return languageTag
        // A languageTag like en_SG@calendar=buddhist should be parseable, but the parse method
        // fails if the character "@" is present ... so we replace it by the "-u-" character
        // chain, which then parses nicely.
        .replaceAll("@", "-u-")
        // Replace all underscores with hyphens
        .replaceAll("_", "-")
        // Replace all equal signs with hyphens
        .replaceAll("=", "-");
  }