From 21fda9af600514f955b2271d2da55f4dd60aace9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 14 May 2020 02:54:56 -0400 Subject: [PATCH] Read & write envvar file as utf-8 #3044 --- core/cli/env.el | 1 + core/core-lib.el | 1 + 2 files changed, 2 insertions(+) diff --git a/core/cli/env.el b/core/cli/env.el index f13a838d3..0230ec9df 100644 --- a/core/cli/env.el +++ b/core/cli/env.el @@ -89,6 +89,7 @@ default, on Linux, this is '$SHELL -ic /usr/bin/env'. Variables in doom-env-file))) (when (or force-p (not (file-exists-p env-file))) (with-temp-file env-file + (setq coding-system-for-write 'utf-8) (print! (start "%s envvars file at %S") (if (file-exists-p env-file) "Regenerating" diff --git a/core/core-lib.el b/core/core-lib.el index 85146ea4c..bf267c14e 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -118,6 +118,7 @@ unreadable. Returns the names of envvars that were changed." (env (with-temp-buffer (save-excursion + (setq coding-system-for-read 'utf-8) (insert "\0\n") ; to prevent off-by-one (insert-file-contents file)) (save-match-data