method Utf8.decode
The text of well-formed UTF-8 bytes, else DecodeError.
Example:
fn main() io {
print(Utf8.decode(Utf8.encode("привет"))!)
}Вывод
привет
pub(api) static fn decode(b: bytes) -> str | DecodeErrorС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
b | bytes |
Возвращает
str
Ошибки
DecodeError@error
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/text.oxl:1074