latin1 -> iso-8859-1

db4
Daniel Ehrenberg 2008-03-21 14:07:17 -04:00
parent 7adef0c613
commit 88baf7c3b7
5 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
USING: arrays io io.files kernel math parser strings system
tools.test words namespaces io.encodings.latin1
tools.test words namespaces io.encodings.8-bit
io.encodings.binary ;
IN: io.tests
@ -9,7 +9,7 @@ IN: io.tests
] unit-test
: <resource-reader> ( resource -- stream )
resource-path latin1 <file-reader> ;
resource-path iso-8859-1 <file-reader> ;
[
"This is a line.\rThis is another line.\r"

View File

@ -1,6 +1,6 @@
USING: io io.files io.streams.duplex kernel sequences
sequences.private strings vectors words memoize splitting
hints unicode.case continuations io.encodings.latin1 ;
hints unicode.case continuations io.encodings.ascii ;
IN: benchmark.reverse-complement
MEMO: trans-map ( -- str )
@ -32,8 +32,8 @@ HINTS: do-line vector string ;
readln [ do-line (reverse-complement) ] [ show-seq ] if* ;
: reverse-complement ( infile outfile -- )
latin1 <file-writer> [
swap latin1 <file-reader> [
ascii <file-writer> [
swap ascii <file-reader> [
swap <duplex-stream> [
500000 <vector> (reverse-complement)
] with-stream

View File

@ -3,7 +3,7 @@
USING: assocs http kernel math math.parser namespaces sequences
io io.sockets io.streams.string io.files io.timeouts strings
splitting calendar continuations accessors vectors
io.encodings.latin1 io.encodings.binary fry ;
io.encodings.8-bit io.encodings.binary fry ;
IN: http.client
DEFER: http-request
@ -52,7 +52,7 @@ PRIVATE>
: http-request ( request -- response stream )
dup request [
dup request-addr latin1 <client>
dup request-addr iso-8859-1 <client>
1 minutes over set-timeout
[
write-request flush
@ -82,7 +82,7 @@ PRIVATE>
: download-to ( url file -- )
#! Downloads the contents of a URL to a file.
swap http-get-stream swap check-response
[ swap latin1 <file-writer> stream-copy ] with-disposal ;
[ swap iso-8859-1 <file-writer> stream-copy ] with-disposal ;
: download ( url -- )
dup download-name download-to ;

View File

@ -4,7 +4,7 @@ USING: assocs kernel namespaces io io.timeouts strings splitting
threads http sequences prettyprint io.server logging calendar
html.elements accessors math.parser combinators.lib
tools.vocabs debugger html continuations random combinators
destructors io.encodings.latin1 fry combinators.cleave ;
destructors io.encodings.8-bit fry combinators.cleave ;
IN: http.server
GENERIC: call-responder ( path responder -- response )
@ -217,7 +217,7 @@ SYMBOL: exit-continuation
: httpd ( port -- )
internet-server "http.server"
latin1 [ handle-client ] with-server ;
iso-8859-1 [ handle-client ] with-server ;
: httpd-main ( -- ) 8888 httpd ;

View File

@ -4,7 +4,7 @@ USING: io io.backend io.launcher io.nonblocking io.unix.backend
io.unix.files io.nonblocking sequences kernel namespaces math
system alien.c-types debugger continuations arrays assocs
combinators unix.process strings threads unix
io.unix.launcher.parser io.encodings.latin1 accessors ;
io.unix.launcher.parser accessors ;
IN: io.unix.launcher
! Search unix first