mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
channels: Consider news files as UTF-8-encoded by default.
Partly fixes <https://issues.guix.gnu.org/57039>. Reported by Pierre-Henry Fröhring <contact@phfrohring.com>. Previously, news file would be read using the current locale encoding. This could lead to a test failure in 'tests/channels.scm' (in a test that expects some Unicode-capable encoding) in case tests were run in a non-Unicode locale. * guix/channels.scm (channel-news-for-commit): Make port for NEWS-FILE UTF-8 by default.
This commit is contained in:
parent
e1b8bace8c
commit
60e0aae89c
1 changed files with 5 additions and 1 deletions
|
@ -1153,7 +1153,11 @@ (define* (channel-news-for-commit channel new #:optional old)
|
|||
(if (and news-file (file-exists? news-file))
|
||||
(with-repository checkout repository
|
||||
(let* ((news (call-with-input-file news-file
|
||||
read-channel-news))
|
||||
(lambda (port)
|
||||
(set-port-encoding! port
|
||||
(or (file-encoding port)
|
||||
"UTF-8"))
|
||||
(read-channel-news port))))
|
||||
(entries (map (lambda (entry)
|
||||
(resolve-channel-news-entry-tag repository
|
||||
entry))
|
||||
|
|
Loading…
Reference in a new issue