mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
Explain why the binary detection works
Extracted from Enricos comment at bug 9146.
This commit is contained in:
parent
5353b406e6
commit
4bea5b9d18
@ -379,6 +379,12 @@ string guessFormatFromContents(FileName const & fn)
|
||||
maybelatex = true;
|
||||
}
|
||||
|
||||
// Note that this is formally not correct, since count_bin_chars
|
||||
// expects utf8, and str can be anything: plain text in any
|
||||
// encoding, or really binary data. In practice it works, since
|
||||
// QString::fromUtf8() drops invalid utf8 sequences, and while
|
||||
// the exact number may not be correct, we still get a high
|
||||
// number for truly binary files.
|
||||
binchars += count_bin_chars(str);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user