Enum Class TruffleString.Encoding

java.lang.Object
java.lang.Enum<TruffleString.Encoding>
com.oracle.truffle.api.strings.TruffleString.Encoding
All Implemented Interfaces:
Serializable, Comparable<TruffleString.Encoding>, Constable
Enclosing class:
TruffleString

public static enum TruffleString.Encoding extends Enum<TruffleString.Encoding>
The list of encodings supported by TruffleString. TruffleString is especially optimized for the following encodings:
  • UTF-32: this means UTF-32 in your system's endianness. TruffleString transparently compacts UTF-32 strings to 8-bit or 16-bit representations, where possible.
  • UTF-16: this means UTF-16 in your system's endianness. TruffleString transparently compacts UTF-16 strings to 8-bit representations, where possible.
  • UTF-8
  • ISO-8859-1
  • US-ASCII
  • BYTES, which is essentially identical to US-ASCII, with the only difference being that BYTES treats all byte values as valid codepoints.

All other encodings are supported using the JRuby JCodings library, which incurs more CompilerDirectives.TruffleBoundary calls. NOTE: to enable support for these encodings, TruffleLanguage.Registration#needsAllEncodings() must be set to true in the truffle language's registration.
Since:
22.1