store new non-UTF-8 files raw and decode to deplay the contents
[?]
Feb 25, 2021, 8:47 AM
UM5DLRPBCQZQBEDJDLDPKODOKLACUHZD6YL6S4JRNKW6JLPNUVSACDependencies
- [2]
W4NSLQNGmake text_encoding available to all of libpijul - [3]
IUH7IMWEContributor license agreements - [4]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [5]
6HNRL5RTdetect non-utf8 text files - [6]
VMOYG7MKtext file decoding for new files - [7]
VO5OQW4WRemoving anyhow in libpijul - [8]
246V5TYIdecode existing files - [9]
NYOF5766track file encoding in the record, including change text for file adds
Change contents
- replacement in libpijul/src/working_copy/mod.rs at line 36
/// Read the file into the buffer, decoding to UTF-8 for text files/// Read the file into the buffer - replacement in libpijul/src/working_copy/mod.rs at line 38
/// Returns the encoding used or None if it was a binary file/// Returns the file's text encoding or None if it was a binary file - replacement in libpijul/src/working_copy/mod.rs at line 48
let (mut decoded, encoding) = if mime.starts_with("text/") {let encoding = if mime.starts_with("text/") { - replacement in libpijul/src/working_copy/mod.rs at line 53
let (decoded, encoding, malformed) = encoding.decode(&uncoded);let (_decoded, encoding, malformed) = encoding.decode(&uncoded); - replacement in libpijul/src/working_copy/mod.rs at line 56
(decoded.as_bytes().to_vec(), Some(Encoding(encoding)))Some(Encoding(encoding)) - replacement in libpijul/src/working_copy/mod.rs at line 59
(uncoded, None)None - replacement in libpijul/src/working_copy/mod.rs at line 62
(uncoded, None)None - replacement in libpijul/src/working_copy/mod.rs at line 64
buffer.append(&mut decoded);buffer.append(&mut uncoded); - file move: text.rs text.rs → text.rs
- file move: mod.rs mod.rs → mod.rs
- replacement in libpijul/src/change/text_changes.rs at line 423
print_contents(&mut w, "+", c)?;print_contents(&mut w, "+", c, encoding)?; - edit in libpijul/src/change/text_changes.rs at line 1173
encoding: &Option<Encoding>, - replacement in libpijul/src/change/text_changes.rs at line 1175
if tree_magic_mini::from_u8(&contents).starts_with("text/") {for a in std::str::from_utf8(&contents).unwrap().split_terminator('\n'){if let Some(encoding) = encoding {for a in encoding.decode(&contents).split_terminator('\n') { - replacement in libpijul/src/change/text_changes.rs at line 1194
print_contents(w, "+", c)?;print_contents(w, "+", c, &None)?; - replacement in libpijul/src/change/text_changes.rs at line 1211
print_contents(w, "-", &buf[..])?;print_contents(w, "-", &buf[..], &None)?;