Handbook
Glossary
iso2022-state
Vocabulary
io
.
encodings
.
iso2022
.
private
Definition
IN:
io.encodings.iso2022.private
TUPLE:
iso2022-state
type
;
Methods
USING:
accessors
byte-arrays
combinators
endian
io
io.encodings
io.encodings.iso2022.private
kernel
;
M::
iso2022-state
decode-char
( stream encoding -- char/f )
stream
stream-read1
{
{
22
[
stream
read-escape
[
encoding
type<<
stream encoding
decode-char
]
[
replacement-char
]
if*
]
}
{
f
[
f
]
}
[
encoding
type>>
double-width?
[
stream
stream-read1
[
2byte-array
be>
encoding
finish-decode
]
[
drop
replacement-char
]
if*
]
[
encoding
finish-decode
]
if
]
}
case
;
USING:
accessors
assocs
io
io.encodings
io.encodings.iso2022.private
kernel
;
M::
iso2022-state
encode-char
( char stream encoding -- )
char encoding
type>>
value?
[
char
find-type
[
stream
stream-write
]
[
encoding
type<<
]
bi*
]
unless
char encoding
type>>
value-at
stream
stream-write-num
;