public abstract static class TruffleString.ToValidStringNode extends Node
valid. See
TruffleString.ToValidStringNode.execute(AbstractTruffleString, TruffleString.Encoding) for details.Node.Child, Node.Children| Modifier and Type | Method and Description |
|---|---|
static TruffleString.ToValidStringNode |
create()
Create a new
TruffleString.SwitchEncodingNode. |
abstract TruffleString |
execute(AbstractTruffleString a,
TruffleString.Encoding expectedEncoding)
Returns a version of string
a that contains only valid codepoints, which may be
the string itself or a converted version. |
static TruffleString.ToValidStringNode |
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, toStringpublic abstract TruffleString execute(AbstractTruffleString a, TruffleString.Encoding expectedEncoding)
a that contains only valid codepoints, which may be
the string itself or a converted version. Invalid byte sequences are replaced with
'�' (for UTF-*) or '?'. This is useful for string sanitization in
all uses cases where a string is required to actually be valid, such
as libraries that actively reject broken input, network and file system I/O, etc.public static TruffleString.ToValidStringNode create()
TruffleString.SwitchEncodingNode.public static TruffleString.ToValidStringNode getUncached()
TruffleString.SwitchEncodingNode.