Fix download-to
parent
948898193c
commit
28182f06f9
extra
http/client
io/encodings
ascii
latin1
|
@ -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 <file-writer> stream-copy ] with-disposal ;
|
||||
swap http-get-stream swap check-response
|
||||
[ swap latin1 <file-writer> stream-copy ] with-disposal ;
|
||||
|
||||
: download ( url -- )
|
||||
dup download-name download-to ;
|
||||
|
|
|
@ -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 ;
|
||||
|
|
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue