public abstract static class TruffleString.SwitchEncodingNode extends Node
TruffleString.SwitchEncodingNode.execute(AbstractTruffleString, TruffleString.Encoding)
for details.Node.Child, Node.Children
Modifier and Type | Method and Description |
---|---|
static TruffleString.SwitchEncodingNode |
create()
Create a new
TruffleString.SwitchEncodingNode . |
TruffleString |
execute(AbstractTruffleString a,
TruffleString.Encoding encoding)
Returns a version of string
a that is encoded in the given encoding, which may be
the string itself or a converted version. |
abstract TruffleString |
execute(AbstractTruffleString a,
TruffleString.Encoding encoding,
TranscodingErrorHandler errorHandler)
Returns a version of string
a that is encoded in the given encoding, which may be
the string itself or a converted version. |
static TruffleString.SwitchEncodingNode |
getUncached()
Get the uncached version of
TruffleString.SwitchEncodingNode . |
accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, toString
public final TruffleString execute(AbstractTruffleString a, TruffleString.Encoding encoding)
a
that is encoded in the given encoding, which may be
the string itself or a converted version. Note that the string itself may be returned
even if it was originally created using a different encoding, if the string is
byte-equivalent in both encodings.
If no lossless conversion is possible, the string is converted on a best-effort basis; no
exception is thrown and characters which cannot be mapped in the target encoding are
replaced by '�'
(for UTF-*) or '?'
.
public abstract TruffleString execute(AbstractTruffleString a, TruffleString.Encoding encoding, TranscodingErrorHandler errorHandler)
a
that is encoded in the given encoding, which may be
the string itself or a converted version. Note that the string itself may be returned
even if it was originally created using a different encoding, if the string is
byte-equivalent in both encodings. Transcoding errors are handled with
errorHandler
.public static TruffleString.SwitchEncodingNode create()
TruffleString.SwitchEncodingNode
.public static TruffleString.SwitchEncodingNode getUncached()
TruffleString.SwitchEncodingNode
.