data Utf8
UTF-8 text/bytes conversion (II.1 Utf8).
Example:
fn main() io {
let b = Utf8.encode("héllo")
print("{b.len()} {Utf8.decode(b)!}")
}Output
6 héllo
pub(api) data Utf8Thread safety. a namespace without state; safe from any task.
Since. 1.0.0-beta
Methods
encode | (text: str) -> bytesThe UTF-8 bytes of a text. |
isValid | (b: bytes) -> boolTrue when b is well-formed UTF-8. |
decode | (b: bytes) -> str | DecodeErrorThe text of well-formed UTF-8 bytes, else DecodeError. |
Defined in: std/core/text.oxl:1036