Package ghidra.program.model.data
Class CharsetInfo
java.lang.Object
ghidra.program.model.data.CharsetInfo
Additional information about
java.nio.charset.Charset's that
Ghidra needs to be able to create Ghidra string datatype instances.
See charset_info.xml to specify a custom charset.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintgetCharsetCharSize(String charsetName) Returns the number of bytes that the specified charset needs to specify a character.String[]Returns an array list of the currently configured charsets.getCharsetNamesWithCharSize(int size) Returns list ofCharsets that encode with the number of bytes specified.static CharsetInfoGet the global singleton instance of thisCharsetInfo.static booleanisBOMCharset(String charsetName) static voidReinitialize registered Charsets and include user defined Charsets specified in charset_info.xml.
-
Field Details
-
UTF8
- See Also:
-
UTF16
- See Also:
-
UTF32
- See Also:
-
USASCII
- See Also:
-
-
Method Details
-
getInstance
Get the global singleton instance of thisCharsetInfo.- Returns:
- global singleton instance
-
isBOMCharset
- Parameters:
charsetName- name of charset- Returns:
- true if the supported multi-byte charset does not specify LE or BE
-
reinitializeWithUserDefinedCharsets
public static void reinitializeWithUserDefinedCharsets()Reinitialize registered Charsets and include user defined Charsets specified in charset_info.xml. -
getCharsetNames
Returns an array list of the currently configured charsets.- Returns:
- String[] of current configured charsets.
-
getCharsetCharSize
Returns the number of bytes that the specified charset needs to specify a character.- Parameters:
charsetName- charset name- Returns:
- number of bytes in a character, ie. 1, 2, 4, etc, defaults to 1 if charset is unknown or not specified in config file.
-
getCharsetNamesWithCharSize
Returns list ofCharsets that encode with the number of bytes specified.- Parameters:
size- the number of bytes for theCharsetencoding.- Returns:
- Charsets that encode one byte characters.
-