OxL Reference

method Utf8.decode

The text of well-formed UTF-8 bytes, else DecodeError.

Example:

oxl✓ checked in CI
fn main() io {
  print(Utf8.decode(Utf8.encode("привет"))!)
}
Output
привет
pub(api) static fn decode(b: bytes) -> str | DecodeError

Since. 1.0.0-beta

Parameters

NameType
bbytes

Returns

str

Errors

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/text.oxl:1074

See also