@FunctionalInterface public interface TranscodingErrorHandler
TruffleString.SwitchEncodingNode
.Modifier and Type | Interface and Description |
---|---|
static class |
TranscodingErrorHandler.ReplacementString
|
Modifier and Type | Field and Description |
---|---|
static TranscodingErrorHandler |
DEFAULT
The default transcoding error handler.
|
static TranscodingErrorHandler |
DEFAULT_KEEP_SURROGATES_IN_UTF8
Same as
TranscodingErrorHandler.DEFAULT , but also keeps UTF-16 surrogate
values in UTF-8. |
Modifier and Type | Method and Description |
---|---|
TranscodingErrorHandler.ReplacementString |
apply(AbstractTruffleString sourceString,
int byteIndex,
int estimatedByteLength,
TruffleString.Encoding sourceEncoding,
TruffleString.Encoding targetEncoding)
Transcoding error handler implementation.
|
static final TranscodingErrorHandler DEFAULT
0xfffd
, in all other encodings it uses '?'
instead. Exceptions: in UTF-16 and
UTF-32, it keeps UTF-16 surrogate values
.static final TranscodingErrorHandler DEFAULT_KEEP_SURROGATES_IN_UTF8
TranscodingErrorHandler.DEFAULT
, but also keeps UTF-16 surrogate
values
in UTF-8.TranscodingErrorHandler.ReplacementString apply(AbstractTruffleString sourceString, int byteIndex, int estimatedByteLength, TruffleString.Encoding sourceEncoding, TruffleString.Encoding targetEncoding)
sourceEncoding
to targetEncoding
.sourceString
- the string currently being transcoded.byteIndex
- starting index of region that could not be transcoded.estimatedByteLength
- estimated byte length of erroneous region.sourceEncoding
- the source string's encoding.targetEncoding
- the target encoding.