Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

Commit

Permalink
Fix #891: Set LC_ALL=C.UTF-8 for all scripts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
teejee2008 committed May 28, 2022
1 parent 8b86200 commit 4e1f920
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Core/Main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 --------------------------------------

Expand Down Expand Up @@ -3733,8 +3733,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);
Expand Down
3 changes: 2 additions & 1 deletion src/Utility/TeeJee.Process.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 4e1f920

Please sign in to comment.