Handbook
Glossary
two-byte ( stream byte -- char )
Vocabulary
io
.
encodings
.
gb18030
.
private
Inputs
stream
an
object
byte
an
object
Outputs
char
an
object
Definition
USING:
assocs
byte-arrays
combinators
io
io.encodings
kernel
namespaces
;
IN:
io.encodings.gb18030.private
:
two-byte
( stream byte -- char )
over
stream-read1
{
{
[
dup
not
]
[
3drop
replacement-char
]
}
{
[
dup
second-byte?
]
[
2byte-array
mapping
get-global
value-at
nip
]
}
{
[
dup
quad-2/4?
]
[
four-byte
]
}
[
3drop
replacement-char
]
}
cond
;