Class UrlUtf8


  • public class UrlUtf8
    extends Object
    Helper to encode and decode URLs to and from UTF-8.
    • Constructor Detail

      • UrlUtf8

        public UrlUtf8()
    • Method Detail

      • encode

        public static String encode​(@Nullable
                                    String text)
        Accepts a text and URL-encodes it based on UTF-8.
        Parameters:
        text - the text to encode.
        Returns:
        the encoded text or an empty string if text was null.
      • decode

        public static String decode​(@Nullable
                                    String text)
        Accepts a text and URL-decodes it based on UTF-8.
        Parameters:
        text - the text to decode.
        Returns:
        the decoded text or an empty string if text was null.