From a8a6ea06df8a9c147f74323ea44b49c682704e07 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 4 Nov 2018 19:33:52 +0100 Subject: [PATCH] compress WIP --- gash/compress.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gash/compress.scm b/gash/compress.scm index 63cc931..d2f7e94 100644 --- a/gash/compress.scm +++ b/gash/compress.scm @@ -41,7 +41,7 @@ (define *program-name* "compress (GASH)") (define (_ msg . rest) - (cons msg rest)) + msg) (define (error* status msg . args) (force-output) @@ -79,6 +79,8 @@ (put-bytevector port (u8-list->bytevector (list #x1F #x9D bits)))) (define (compress-port in out bits verbose?) + (set-port-encoding! in "ISO-8859-1") + (set-port-encoding! out "ISO-8859-1") #; (begin (write-lzw-header out bits) @@ -101,7 +103,7 @@ (error* 1 (_ "~a: already exists") outfile)) (let ((in (open-file infile "rb")) (out (open-file outfile "wb"))) - ;; TODO: Keep original files ownership, modes, and access + ;; TODO: Keep original files ownership, modes, and access ;; and modification times. (compress-port in out bits verbose?) (when verbose? @@ -123,6 +125,8 @@ (x #f))) (define (uncompress-port in out verbose?) + (set-port-encoding! in "ISO-8859-1") + (set-port-encoding! out "ISO-8859-1") (let ((bits (read-lzw-header in))) (unless bits (error* 1 (_ "incorrect header")))