From ebff7467cbfaede80642e8e7c13725ebb373ec7b Mon Sep 17 00:00:00 2001 From: joveian Date: Thu, 12 Jan 2023 14:46:43 -0800 Subject: [PATCH] Warn of any unicode replacement characters Unicode replacement characters mean --check is not able to check the file so warn when generating them. This time with NAME. Fixes issue #281 --- b3sum/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs index 91a87a1..7193c6c 100644 --- a/b3sum/src/main.rs +++ b/b3sum/src/main.rs @@ -340,6 +340,9 @@ fn filepath_to_string(filepath: &Path) -> FilepathString { filepath_string = filepath_string.replace('\\', "\\\\").replace('\n', "\\n"); is_escaped = true; } + if filepath_string.contains('�') { + eprintln!("{}: {}: must be valid unicode and not contain '�' for --check", NAME, filepath_string); + } FilepathString { filepath_string, is_escaped,