diff options
author | Marius Bakke <marius@gnu.org> | 2022-11-26 15:39:18 +0100 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2022-11-26 15:39:18 +0100 |
commit | fe99fe84f0fe5b4cd97768c6dbb60a07404f24a1 (patch) | |
tree | c87214ce4b80f0eb9a068553cc25f201bddae66c /guix/scripts/style.scm | |
parent | 2e68be4ca88368c94b1eb1123ef437605b7b904f (diff) | |
parent | c457c715a83358fa1557f703b1e459435fb1a259 (diff) |
Merge branch 'master' into staging
Diffstat (limited to 'guix/scripts/style.scm')
-rw-r--r-- | guix/scripts/style.scm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm index c0b9ea1a28..fa7175fb16 100644 --- a/guix/scripts/style.scm +++ b/guix/scripts/style.scm @@ -335,13 +335,15 @@ PACKAGE." (define* (format-whole-file file #:rest rest) "Reformat all of FILE." - (let ((lst (call-with-input-file file read-with-comments/sequence))) - (with-atomic-file-output file - (lambda (port) - (apply pretty-print-with-comments/splice port lst - #:format-comment canonicalize-comment - #:format-vertical-space canonicalize-vertical-space - rest))))) + (with-fluids ((%default-port-encoding "UTF-8")) + (let ((lst (call-with-input-file file read-with-comments/sequence + #:guess-encoding #t))) + (with-atomic-file-output file + (lambda (port) + (apply pretty-print-with-comments/splice port lst + #:format-comment canonicalize-comment + #:format-vertical-space canonicalize-vertical-space + rest)))))) ;;; |