Handbook
Glossary
code-point-length ( n -- x )
Vocabulary
io
.
encodings
.
utf8
Inputs
n
an
object
Outputs
x
an
object
Definition
USING:
combinators
kernel
math
math.order
;
IN:
io.encodings.utf8
:
code-point-length
( n -- x )
[
1
]
[
log2
{
{
[
dup
0 6
between?
]
[
1
]
}
{
[
dup
7 10
between?
]
[
2
]
}
{
[
dup
11 15
between?
]
[
3
]
}
{
[
dup
16 20
between?
]
[
4
]
}
}
cond
nip
]
if-zero
;