Handbook
Glossary
four-byte ( stream byte1 byte2 -- char )
Vocabulary
io
.
encodings
.
gb18030
.
private
Inputs
stream
an
object
byte1
an
object
byte2
an
object
Outputs
char
an
object
Definition
USING:
byte-arrays
io
io.encodings
kernel
sequences
;
IN:
io.encodings.gb18030.private
:
four-byte
( stream byte1 byte2 -- char )
rot
2
swap
stream-read
dup
last-bytes?
[
first2
4byte-array
decode-quad
]
[
3drop
replacement-char
]
if
;