diff --git a/guix/derivations.scm b/guix/derivations.scm
index d70bd9dd8557c6c0739908c62d5dca8c40a87e06..2243d2ba460a0c189a3c0db6ad255e6722f0cab7 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -741,14 +741,21 @@ (define %build-inputs
                       (unsetenv "LD_LIBRARY_PATH")))
          (builder  (add-text-to-store store
                                       (string-append name "-guile-builder")
-                                      (string-append
-                                       (object->string prologue)
-                                       (object->string
-                                        `(exit
-                                          ,(match exp
-                                             ((_ ...)
-                                              (remove module-form? exp))
-                                             (_ `(,exp))))))
+
+                                      ;; Explicitly use UTF-8 for determinism,
+                                      ;; and also because UTF-8 output is faster.
+                                      (with-fluids ((%default-port-encoding
+                                                     "UTF-8"))
+                                        (call-with-output-string
+                                         (lambda (port)
+                                           (write prologue port)
+                                           (write
+                                            `(exit
+                                              ,(match exp
+                                                 ((_ ...)
+                                                  (remove module-form? exp))
+                                                 (_ `(,exp))))
+                                            port))))
 
                                       ;; The references don't really matter
                                       ;; since the builder is always used in