[pve-devel] [PATCH pve-cluster 3/3] fix #4937: notify: write configuration files in utf8 encoding

Lukas Wagner l.wagner at proxmox.com
Wed Aug 30 14:37:54 CEST 2023


Strings that are returned from the Rust implementation are encoded as
utf8. To avoid issues with certain special characters (e.g. german
umlauts), we also need to explicitly store the configuration files in
utf8 encoding.

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 src/PVE/Notify.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/Notify.pm b/src/PVE/Notify.pm
index 0464362..d393a41 100644
--- a/src/PVE/Notify.pm
+++ b/src/PVE/Notify.pm
@@ -79,8 +79,8 @@ sub write_config {
     };
 
     my ($config, $priv_config) = $notification_config->write_config();
-    cfs_write_file('notifications.cfg', $config);
-    cfs_write_file('priv/notifications.cfg', $priv_config);
+    cfs_write_file('notifications.cfg', $config, "utf8");
+    cfs_write_file('priv/notifications.cfg', $priv_config, "utf8");
 }
 
 sub default_target {
-- 
2.39.2






More information about the pve-devel mailing list