Package com.iizix.codepage
Class CodepageMapper
java.lang.Object
com.iizix.codepage.CodepageMapper
Maps ASCII to/from Unicode, EBCDIC to/from Unicode, Ansi to/from Unicode.
- Author:
- Christopher Mindus
- See Also:
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionstatic char
convertAnsiToChar
(byte b) Converts a single Ansi byte to character.static char[]
convertAnsiToChar
(byte[] b) Converts an array of Ansi bytes to an array of characters.static String
convertAnsiToString
(byte[] b) Converts an array of Ansi bytes to a string.static String
convertAnsiToString
(byte[] b, int offset, int length) Converts an array of Ansi bytes to a string.static char
convertASCIIToChar
(byte b) Converts a single ASCII byte to character.static char[]
convertASCIIToChar
(byte[] b) Converts an array of ASCII bytes to an array of characters.static String
convertASCIIToString
(byte[] b) Converts an array of ASCII bytes to a string.static String
convertASCIIToString
(byte[] b, int offset, int length) Converts an array of ASCII bytes to a string.static byte
convertCharToAnsi
(char c) Converts a single character to Ansi byte.static byte[]
convertCharToAnsi
(char[] c) Converts an array of characters to an array of Ansi bytes.static byte
convertCharToASCII
(char c) Converts a single character to ASCII byte.static byte[]
convertCharToASCII
(char[] c) Converts an array of characters to an array of ASCII bytes.static byte
convertCharToEBCDIC
(char c) Converts a single character to EBCDIC byte.static byte[]
convertCharToEBCDIC
(char[] c) Converts an array of characters to an array of EBCDIC bytes.static char
convertEBCDICToChar
(byte b) Converts a single EBCDIC byte to character.static char[]
convertEBCDICToChar
(byte[] b) Converts an array of EBCDIC bytes to an array of characters.static String
convertEBCDICToString
(byte[] b) Converts an array of EBCDIC bytes to a string.static String
convertEBCDICToString
(byte[] b, int offset, int length) Converts an array of EBCDIC bytes to a string.static byte[]
Converts a string to an array of Ansi bytes.static byte[]
Converts a string to an array of ASCII bytes.static byte[]
Converts a string to an array of EBCDIC bytes.static CodepageConverter
Creates an instance of a codepage converter class.static final CodepageConverter
Gets the codepage converter for Ansi.static final CodepageConverter
Gets the codepage converter for ASCII.static int
Gets the current EBCDIC code page value, e.g.static final CodepageConverter
Gets the codepage converter for EBCDIC.static boolean
Sets the Ansi codepage.static boolean
Sets the ASCII codepage.static boolean
Sets the EBCDIC codepage.
Constructor Details
CodepageMapper
public CodepageMapper()
Method Details
createCodepageConverter
Creates an instance of a codepage converter class.- Returns:
- null if codepage is not found.
setAnsi
Sets the Ansi codepage.setASCII
Sets the ASCII codepage.setEBCDIC
Sets the EBCDIC codepage.getASCIIConverter
Gets the codepage converter for ASCII.getAnsiConverter
Gets the codepage converter for Ansi.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
Converts an array of Ansi bytes to a string.convertAnsiToString
Converts an array of Ansi bytes to a string.convertStringToAnsi
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
Converts an array of ASCII bytes to a string.convertASCIIToString
Converts an array of ASCII bytes to a string.convertStringToASCII
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
Converts an array of EBCDIC bytes to a string.convertEBCDICToString
Converts an array of EBCDIC bytes to a string.convertStringToEBCDIC
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...