From 5703a2b9431f52cdbc712ddd44dd685e3a57a517 Mon Sep 17 00:00:00 2001 From: Tony George Date: Sat, 28 May 2022 13:23:36 +0530 Subject: [PATCH] Fix #891: Set LC_ALL=C.UTF-8 for all scripts save_bash_script_temp() is a common function that is used by all functions that execute Rsync. Set LC_ALL=C.UTF-8 for all scripts. --- src/Core/Main.vala | 6 +++--- src/Utility/TeeJee.Process.vala | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Core/Main.vala b/src/Core/Main.vala index adbdc0d..bb53e38 100644 --- a/src/Core/Main.vala +++ b/src/Core/Main.vala @@ -2248,7 +2248,7 @@ public class Main : GLib.Object{ log_debug("Main: create_restore_scripts()"); - string sh = ""; + string sh = "export LC_ALL=C.UTF-8\n"; // create scripts -------------------------------------- @@ -3741,8 +3741,8 @@ public class Main : GLib.Object{ } save_exclude_list_for_backup(TEMP_DIR); - - cmd = "LC_ALL=C ; rsync -ai --delete --numeric-ids --relative --stats --dry-run --delete-excluded --exclude-from='%s' /. '%s' &> '%s'".printf(file_exclude_list, dir_empty, file_log); + + cmd = "export LC_ALL=C.UTF-8 ; rsync -ai --delete --numeric-ids --relative --stats --dry-run --delete-excluded --exclude-from='%s' /. '%s' &> '%s'".printf(file_exclude_list, dir_empty, file_log); log_debug(cmd); ret_val = exec_script_sync(cmd, out std_out, out std_err); diff --git a/src/Utility/TeeJee.Process.vala b/src/Utility/TeeJee.Process.vala index eb11f6e..d52d270 100644 --- a/src/Utility/TeeJee.Process.vala +++ b/src/Utility/TeeJee.Process.vala @@ -204,7 +204,8 @@ namespace TeeJee.ProcessHelper{ script.append ("#!/bin/bash\n"); script.append ("\n"); if (force_locale){ - script.append ("LANG=C\n"); + script.append("LANG=C\n"); + script.append("LC_ALL=C.UTF-8\n"); } script.append ("\n"); script.append ("%s\n".printf(commands));