diff --git a/core/io/encodings/utf16/utf16.factor b/core/io/encodings/utf16/utf16.factor index 0660ddfd77..24491a7a26 100644 --- a/core/io/encodings/utf16/utf16.factor +++ b/core/io/encodings/utf16/utf16.factor @@ -2,7 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors byte-arrays combinators io io.binary io.encodings kernel math math.private namespaces sbufs -sequences sequences.private splitting strings.private vectors ; +sequences sequences.private splitting strings strings.private +vectors ; IN: io.encodings.utf16 SINGLETON: utf16be @@ -115,13 +116,13 @@ M: utf16le encode-char ( char stream encoding -- ) M: utf16le encode-string drop - over aux>> + over dup string? [ aux>> ] [ drop t ] if [ [ char>utf16le ] curry each ] [ ascii-string>utf16le ] if ; M: utf16be encode-string drop - over aux>> + over dup string? [ aux>> ] [ drop t ] if [ [ char>utf16be ] curry each ] [ ascii-string>utf16be ] if ; diff --git a/core/io/encodings/utf8/utf8.factor b/core/io/encodings/utf8/utf8.factor index 28ce4899f0..d07893c0ef 100644 --- a/core/io/encodings/utf8/utf8.factor +++ b/core/io/encodings/utf8/utf8.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2006, 2008 Daniel Ehrenberg. ! See http://factorcode.org/license.txt for BSD license. USING: accessors combinators io io.encodings -io.encodings.private kernel math math.order sequences ; +io.encodings.private kernel math math.order sequences strings ; IN: io.encodings.utf8 ! Decoding UTF-8 @@ -86,7 +86,7 @@ M: utf8 encode-char M: utf8 encode-string drop - over aux>> + over dup string? [ aux>> ] [ drop t ] if [ [ char>utf8 ] curry each ] [ [ string>byte-array-fast ] dip stream-write ] if ;