]> gitweb.factorcode.org Git - factor.git/blob - core/io/utf8/utf8-docs.factor
Initial import
[factor.git] / core / io / utf8 / utf8-docs.factor
1 USING: help.markup help.syntax io.encodings strings ;
2 IN: io.utf8
3
4 ARTICLE: "io.utf8" "Working with UTF8-encoded data"
5 "The UTF8 encoding is a variable-width encoding. 7-bit ASCII characters are encoded as single bytes, and other Unicode code points are encoded as 2 to 4 byte sequences."
6 { $subsection encode-utf8 }
7 { $subsection decode-utf8 } ;
8
9 ABOUT: "io.utf8"
10
11 HELP: decode-utf8
12 { $values { "seq" "a sequence of bytes" } { "str" string } }
13 { $description "Decodes a sequence of bytes representing a Unicode string in UTF8 format." }
14 { $errors "Throws a " { $link decode-error } " if the input is malformed." } ;
15
16 HELP: encode-utf8
17 { $values { "str" string } { "seq" "a sequence of bytes" } }
18 { $description "Encodes a Unicode string as a sequence of bytes in UTF8 format." } ;