Encode the String to its Buf representation per the charset
Some(String representation of the Buf)
This extractor does *not* return None to indicate a failed or impossible decoding. Malformed or unmappable bytes will instead be silently replaced by the replacement character ("�") in the returned String. This behavior may change in the future.
A StringCoder for a given java.nio.charset.Charset provides an encoder:
String
to Buf and an extractor: Buf toOption[String]
.Malformed and unmappable input is silently replaced see java.nio.charset.CodingErrorAction.REPLACE
Utf8 for UTF-8 encoding and decoding, and
Bufs.UTF8
for Java users. Constants exist for other standard charsets as well.