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)!}")
}Вывод
6 héllo
pub(api) data Utf8Потокобезопасность. a namespace without state; safe from any task.
С версии. 1.0.0-beta
Методы
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. |
Определено в: std/core/text.oxl:1036