Package util

Class ASCIICoder

java.lang.Object
util.ASCIICoder

public class ASCIICoder extends Object
Class for encoding and decoding strings with ASCII escape sequences
Since:
2006.10.05
  • Constructor Details

    • ASCIICoder

      public ASCIICoder()
      Create an ASCII coder (dummy).
      Since:
      2023.07.26 (Christian Borgelt)
  • Method Details

    • encode

      public static String encode(String s)
      Encode a string using ASCII escape sequences.
      Parameters:
      s - the string to encode
      Returns:
      the string with all non-printable characters replaced by ASCII escape sequences
      Since:
      2006.10.05 (Christian Borgelt)
    • decode

      public static String decode(String s)
      Decode ASCII escape sequences in a string.
      Parameters:
      s - the string to decode
      Returns:
      the string with all ASCII escape sequences replaced by their corresponding characters
      Since:
      2006.10.05 (Christian Borgelt)
    • main

      public static void main(String[] args)
      Main function for testing basic functionality.
      Parameters:
      args - the command line arguments
      Since:
      2006.10.05 (Christian Borgelt)