Fix load errors

db4
Slava Pestov 2008-02-14 01:04:16 -06:00
parent 0bbb462fa6
commit ce59673c12
2 changed files with 5 additions and 9 deletions

2
core/io/encodings/latin1/latin1.factor Normal file → Executable file
View File

@ -1,4 +1,4 @@
USING: io.encodings strings kernel ;
USING: io io.encodings strings kernel ;
IN: io.encodings.latin1
TUPLE: latin1 stream ;

View File

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