method Utf8.decode
The text of well-formed UTF-8 bytes, else DecodeError.
Example:
fn main() io {
print(Utf8.decode(Utf8.encode("привет"))!)
}Output
привет
pub(api) static fn decode(b: bytes) -> str | DecodeErrorSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
b | bytes |
Returns
str
Errors
DecodeError@error
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:1074