Handbook
Glossary
char>utf8 ( char stream -- )
Vocabulary
io
.
encodings
.
utf8
.
private
Inputs
char
an
object
stream
an
object
Outputs
None
Definition
USING:
combinators
io
kernel
math
;
IN:
io.encodings.utf8.private
:
char>utf8
( char stream -- )
over
127
<=
[
stream-write1
]
[
swap
{
{
[
dup
-11
shift
zero?
]
[
2dup
-6
shift
192
bitor
swap
stream-write1
encoded
]
}
{
[
dup
-16
shift
zero?
]
[
2dup
-12
shift
224
bitor
swap
stream-write1
2dup
-6
shift
encoded
encoded
]
}
[
2dup
-18
shift
240
bitor
swap
stream-write1
2dup
-12
shift
encoded
2dup
-6
shift
encoded
encoded
]
}
cond
]
if
;
inline