Because https://www.mercurial-scm.org/wiki/EncodingStrategy#The_encoding_tracking_problem says that roundtripping through UTF-8 is lossy
UM5DLRPBCQZQBEDJDLDPKODOKLACUHZD6YL6S4JRNKW6JLPNUVSAC
W4NSLQNGQVQBB4BEXLFW5OTCBD5XQ4E2BGH3WIFGKSJBCODSUIGQC
IUH7IMWES3KQTHVWA5UNHAO7QWVCC5PQJ6VLK3RC3T4F2MS74P3AC
246V5TYIUL7CFN7G5Y7A35EEM6IJPN532ROEYVSM7Q4HCQSWPDBQC
NYOF5766GLBTWQV2KTVRAJMGVJNJ37Z5BLJMFPZA3HG7X2Q2RXPAC
SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC
6HNRL5RT76NH5YNSUN7B4FHNRZXKNLX4DROFGMO4R5P2U7JWOL2QC
VO5OQW4W2656DIYYRNZ3PO7TQ4JOKQ3GVWE5ALUTYVMX3WMXJOYQC
VMOYG7MKEWTUEEY2EOL256RWCVPGRD63IFOSKXHBGJ6VSRITLMOAC
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') {