From 28182f06f9719220e489c3d67119b151d8696f7f Mon Sep 17 00:00:00 2001 From: dharmatech Date: Fri, 7 Mar 2008 23:47:11 -0600 Subject: [PATCH] Fix download-to --- extra/http/client/client.factor | 4 ++-- extra/io/encodings/ascii/ascii.factor | 2 +- extra/io/encodings/latin1/latin1.factor | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/http/client/client.factor b/extra/http/client/client.factor index f011ff537e..0d733ba97d 100755 --- a/extra/http/client/client.factor +++ b/extra/http/client/client.factor @@ -82,8 +82,8 @@ PRIVATE> : download-to ( url file -- ) #! Downloads the contents of a URL to a file. - swap http-get-stream check-response - [ swap binary stream-copy ] with-disposal ; + swap http-get-stream swap check-response + [ swap latin1 stream-copy ] with-disposal ; : download ( url -- ) dup download-name download-to ; diff --git a/extra/io/encodings/ascii/ascii.factor b/extra/io/encodings/ascii/ascii.factor index fdefc35634..1c50e4c2a4 100644 --- a/extra/io/encodings/ascii/ascii.factor +++ b/extra/io/encodings/ascii/ascii.factor @@ -9,7 +9,7 @@ IN: io.encodings.ascii TUPLE: ascii ; M: ascii stream-write-encoded ( string stream encoding -- ) - drop 127 encode-check<= ; + drop 128 encode-check<= ; M: ascii decode-step drop dup 128 >= [ decode-error ] [ swap push ] if ; diff --git a/extra/io/encodings/latin1/latin1.factor b/extra/io/encodings/latin1/latin1.factor index 989f45bc64..3cb361b2fd 100755 --- a/extra/io/encodings/latin1/latin1.factor +++ b/extra/io/encodings/latin1/latin1.factor @@ -6,7 +6,7 @@ IN: io.encodings.latin1 TUPLE: latin1 ; M: latin1 stream-write-encoded - drop 255 encode-check<= ; + drop 256 encode-check<= ; M: latin1 decode-step - drop dup 256 >= [ decode-error ] [ swap push ] if ; + drop swap push ;