Class CodepageMapper

java.lang.Object
com.iizix.codepage.CodepageMapper

public class CodepageMapper extends Object
Maps ASCII to/from Unicode, EBCDIC to/from Unicode, Ansi to/from Unicode.
Author:
Christopher Mindus
See Also:
  • Constructor Details

    • CodepageMapper

      public CodepageMapper()
  • Method Details

    • createCodepageConverter

      public static CodepageConverter createCodepageConverter(String cp)
      Creates an instance of a codepage converter class.
      Returns:
      null if codepage is not found.
    • setAnsi

      public static boolean setAnsi(String cp)
      Sets the Ansi codepage.
    • setASCII

      public static boolean setASCII(String cp)
      Sets the ASCII codepage.
    • setEBCDIC

      public static boolean setEBCDIC(String cp)
      Sets the EBCDIC codepage.
    • getASCIIConverter

      public static final CodepageConverter getASCIIConverter()
      Gets the codepage converter for ASCII.
    • getAnsiConverter

      public static final CodepageConverter getAnsiConverter()
      Gets the codepage converter for Ansi.
    • getEBCDICConverter

      public static final CodepageConverter getEBCDICConverter()
      Gets the codepage converter for EBCDIC.
    • convertAnsiToChar

      public static char convertAnsiToChar(byte b)
      Converts a single Ansi byte to character.
    • convertAnsiToChar

      public static char[] convertAnsiToChar(byte[] b)
      Converts an array of Ansi bytes to an array of characters.
    • convertCharToAnsi

      public static byte convertCharToAnsi(char c)
      Converts a single character to Ansi byte.
    • convertCharToAnsi

      public static byte[] convertCharToAnsi(char[] c)
      Converts an array of characters to an array of Ansi bytes.
    • convertAnsiToString

      public static String convertAnsiToString(byte[] b)
      Converts an array of Ansi bytes to a string.
    • convertAnsiToString

      public static String convertAnsiToString(byte[] b, int offset, int length)
      Converts an array of Ansi bytes to a string.
    • convertStringToAnsi

      public static byte[] convertStringToAnsi(String s)
      Converts a string to an array of Ansi bytes.
    • convertASCIIToChar

      public static char convertASCIIToChar(byte b)
      Converts a single ASCII byte to character.
    • convertASCIIToChar

      public static char[] convertASCIIToChar(byte[] b)
      Converts an array of ASCII bytes to an array of characters.
    • convertCharToASCII

      public static byte convertCharToASCII(char c)
      Converts a single character to ASCII byte.
    • convertCharToASCII

      public static byte[] convertCharToASCII(char[] c)
      Converts an array of characters to an array of ASCII bytes.
    • convertASCIIToString

      public static String convertASCIIToString(byte[] b)
      Converts an array of ASCII bytes to a string.
    • convertASCIIToString

      public static String convertASCIIToString(byte[] b, int offset, int length)
      Converts an array of ASCII bytes to a string.
    • convertStringToASCII

      public static byte[] convertStringToASCII(String s)
      Converts a string to an array of ASCII bytes.
    • convertEBCDICToChar

      public static char convertEBCDICToChar(byte b)
      Converts a single EBCDIC byte to character.
    • convertEBCDICToChar

      public static char[] convertEBCDICToChar(byte[] b)
      Converts an array of EBCDIC bytes to an array of characters.
    • convertCharToEBCDIC

      public static byte convertCharToEBCDIC(char c)
      Converts a single character to EBCDIC byte.
    • convertCharToEBCDIC

      public static byte[] convertCharToEBCDIC(char[] c)
      Converts an array of characters to an array of EBCDIC bytes.
    • convertEBCDICToString

      public static String convertEBCDICToString(byte[] b)
      Converts an array of EBCDIC bytes to a string.
    • convertEBCDICToString

      public static String convertEBCDICToString(byte[] b, int offset, int length)
      Converts an array of EBCDIC bytes to a string.
    • convertStringToEBCDIC

      public static byte[] convertStringToEBCDIC(String s)
      Converts a string to an array of EBCDIC bytes.
    • getCurrentEBCDICCodePage

      public static int getCurrentEBCDICCodePage()
      Gets the current EBCDIC code page value, e.g. 37, 278, 500...