OxL Reference

method Utf8.encode

The UTF-8 bytes of a text.

Example:

oxl✓ checked in CI
fn main() io {
  print("{Utf8.encode("hi").len()}")
}
Output
2
pub(api) static fn encode(text: str) -> bytes

Since. 1.0.0-beta

Parameters

NameType
textstr

Returns

bytes

Effects

none declared (pure unless the body says otherwise)

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

See also