method Utf8.encode
The UTF-8 bytes of a text.
Example:
fn main() io {
print("{Utf8.encode("hi").len()}")
}Output
2
pub(api) static fn encode(text: str) -> bytesSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
text | str |
Returns
bytes
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:1050