Fix load errors
parent
0bbb462fa6
commit
ce59673c12
|
|
@ -1,4 +1,4 @@
|
||||||
USING: io.encodings strings kernel ;
|
USING: io io.encodings strings kernel ;
|
||||||
IN: io.encodings.latin1
|
IN: io.encodings.latin1
|
||||||
|
|
||||||
TUPLE: latin1 stream ;
|
TUPLE: latin1 stream ;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: math kernel sequences sbufs vectors namespaces io.binary
|
USING: math kernel sequences sbufs vectors namespaces io.binary
|
||||||
io.encodings combinators splitting ;
|
io.encodings combinators splitting ;
|
||||||
IN: io.utf16
|
IN: io.encodings.utf16
|
||||||
|
|
||||||
SYMBOL: double
|
SYMBOL: double
|
||||||
SYMBOL: quad1
|
SYMBOL: quad1
|
||||||
|
|
@ -104,14 +104,10 @@ SYMBOL: ignore
|
||||||
: encode-utf16 ( str -- seq )
|
: encode-utf16 ( str -- seq )
|
||||||
encode-utf16le bom-le swap append ;
|
encode-utf16le bom-le swap append ;
|
||||||
|
|
||||||
: utf16le? ( seq1 -- seq2 ? ) bom-le ?head ;
|
|
||||||
|
|
||||||
: utf16be? ( seq1 -- seq2 ? ) bom-be ?head ;
|
|
||||||
|
|
||||||
: decode-utf16 ( seq -- str )
|
: decode-utf16 ( seq -- str )
|
||||||
{
|
{
|
||||||
{ [ utf16le? ] [ decode-utf16le ] }
|
{ [ bom-le ?head ] [ decode-utf16le ] }
|
||||||
{ [ utf16be? ] [ decode-utf16be ] }
|
{ [ bom-be ?head ] [ decode-utf16be ] }
|
||||||
{ [ t ] [ decode-error ] }
|
{ [ t ] [ decode-error ] }
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
|
|
@ -127,4 +123,4 @@ TUPLE: utf16be ;
|
||||||
INSTANCE: utf16be encoding-stream
|
INSTANCE: utf16be encoding-stream
|
||||||
|
|
||||||
M: utf16be encode-string drop encode-utf16be ;
|
M: utf16be encode-string drop encode-utf16be ;
|
||||||
M: utf16le decode-step drop decode-utf16be-step ;
|
M: utf16be decode-step drop decode-utf16be-step ;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue