Skip to content

Commit 6d04d5f

Browse files
committed
docs
1 parent c17117d commit 6d04d5f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sdiff.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ pub fn main(opts: Peekable<ArgsOs>) -> ExitCode {
6969
// ok, now we start running over the lines and get the lines right
7070
// and left file
7171
for i in 0..max_lines {
72-
let left = lines_left.get(i).map(|l| String::from_utf8_lossy(l)); // we can convert this is ut8?
72+
// now we convert the bytes to utf8. May the file is encoded with invalid chars,
73+
// so it can result in a line with �.
74+
let left = lines_left.get(i).map(|l| String::from_utf8_lossy(l));
7375
let right = lines_rght.get(i).map(|r| String::from_utf8_lossy(r));
7476

7577
match (left, right) {

0 commit comments

Comments
 (0)