diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-03-08 22:21:31 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-03-08 23:42:53 +0100 |
commit | 1062063a65036f32a061c54866d33ffe079ec44e (patch) | |
tree | 99353fb630fadaa654d3cdb856669b878a098a26 /guix | |
parent | 30906825cb99122f6b068a1d9223937757d75ce5 (diff) | |
download | gnu-guix-1062063a65036f32a061c54866d33ffe079ec44e.tar gnu-guix-1062063a65036f32a061c54866d33ffe079ec44e.tar.gz |
ui: Don't use '%default-port-encoding' to set the encoding of string ports.
* guix/ui.scm (right-arrow): Call 'set-port-encoding!' to set PORT's
encoding; remove use of 'with-fluids'. This is for compatibility with
Guile 2.2 where the encoding of string ports is not influenced by
%DEFAULT-PORT-ENCODING.
* tests/ui.scm ("show-manifest-transaction"): Likewise.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/ui.scm | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/guix/ui.scm b/guix/ui.scm index 5ae082fc0a..3a0a6501d1 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -635,16 +635,17 @@ report what is prerequisites are available for download." (define (right-arrow port) "Return either a string containing the 'RIGHT ARROW' character, or an ASCII replacement if PORT is not Unicode-capable." - (with-fluids ((%default-port-encoding (port-encoding port))) - (let ((arrow "→")) - (catch 'encoding-error - (lambda () - (call-with-output-string - (lambda (port) - (set-port-conversion-strategy! port 'error) - (display arrow port)))) - (lambda (key . args) - "->"))))) + (let ((encoding (port-encoding port)) + (arrow "→")) + (catch 'encoding-error + (lambda () + (call-with-output-string + (lambda (port) + (set-port-encoding! port encoding) + (set-port-conversion-strategy! port 'error) + (display arrow port)))) + (lambda (key . args) + "->")))) (define* (show-manifest-transaction store manifest transaction #:key dry-run?) |