* guix/serialization.scm (read-maybe-utf8-string): New procedure.
* guix/store.scm (process-stderr): Use it for the build log and errors.
* tests/store.scm ("current-build-output-port, UTF-8",
"current-build-output-port, UTF-8 + garbage"): New tests.
Fixes <http://bugs.gnu.org/19756>.
Reported by <sleep_walker@suse.cz>.
* guix/serialization.scm (currently-restored-file): New variable.
(get-bytevector-n*): New procedure.
(read-int, read-long-long, read-string, read-latin1-string,
read-contents): Use it instead of 'get-bytevector-n'.
(restore-file): Parameterize 'currently-restored-file' and set it.
* tests/nar.scm ("restore-file with incomplete input"): New test.
* guix/serialization.scm (read-latin1-string): Use 'get-bytevector-n'
instead of 'get-string-n'. Use 'list->string' etc. to convert the
bytevector to a string.