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.
This commit is contained in:
Tony George 2022-05-28 13:23:36 +05:30 committed by Clement Lefebvre
parent c45e754c7f
commit 5703a2b943
2 changed files with 5 additions and 4 deletions

View File

@ -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);

View File

@ -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));