Interface UrlFormatter


public interface UrlFormatter
Cleans up urls that go into chat components, where a raw ampersand or a non-ASCII host would otherwise be mangled.
  • Method Details

    • escapeAmpersand

      String escapeAmpersand(String url)
      Escapes ampersands so they are not read as legacy color codes.
      Parameters:
      url - the url
      Returns:
      the escaped url
    • unescapeAmpersand

      String unescapeAmpersand(String url)
      Restores ampersands escaped by escapeAmpersand(String).
      Parameters:
      url - the escaped url
      Returns:
      the original url
    • toASCII

      String toASCII(String url)
      Converts an international domain name to its ASCII form, so the client can open it.
      Parameters:
      url - the url
      Returns:
      the ASCII url, or the input unchanged if it cannot be converted