0

I'm using TED Notepad in Windows 10.

When I try to open some of the .txt files I've edited in the last few days, I receive the following message: "Warning: Loaded file is binary. Edit with care." I click on OK, and the file is blank - though if I press Ctrl+A a paragraph of invisible characters is highlighted, its size roughly proportional to the length of the work (prose, not code) that I last saved. There is also a recovery file (suffix .txt.~) following each of the affected .txt files in the directory, but this does not disappear after the file is saved and closed, as was formerly the case. Files I have not recently edited before today open as normal, but are affected by the second issue of recovery files persisting in their directory.

The files are on a new micro SDXC card. I edited some, possibly all, of these files in a USB-stick installation of Linux Mint Xfce that has problems of its own (it restores itself to 'factory settings' on reboot, with all settings lost). I'm now back on Windows, for the time being at least. TED Notepad's encoding is set to UTF-8; I have not changed that or any other setting in a very long time.

I have tried:

  • Opening the files using other programs (in Windows Notepad, the file appears the same, as a paragraph of blank characters; in LibreOffice Writer, the file appears as a paragraph of hash/ pound/ # symbols).
  • Copying and pasting the invisible contents from TED Notepad into various new documents (yielding a paragraph of invisible characters in Windows Notepad and TED Notepad, and a single line of the same in LibreOffice Writer).
  • Inserting the SD card into another computer, with the same results.
  • Using online tools to attempt to recover my writing, including onlineutf8tools.com/convert-binary-to-utf8 (output remains blank).

I wonder

  1. why this (files loading as binary) is happening,
  2. whether the persistent recovery files have anything to do with it,
  3. if there is a way to prevent these behaviours from occurring, and
  4. if there is a way of rescuing my work from the blank files.

Thank you for any light you may be able to shed.

Dade McDade
  • 176
  • 1
  • 7

1 Answers1

1

Sounds like the files are corrupted. The cause may be filesystem corruption, which in turn would most likely be caused by SDXC card's fault. SD cards aren't very reliable in general, mostly due to them being sensitive to physical stress. If the card was cheap, you may have bought a knockoff. There's a lot of fake cards on the market that in reality have smaller capacity than advertised and wrap around when the actual capacity is exceeded, destroying data on them.

Restore the corrupted files from backup and switch to a more reliable storage medium. A flash drive would be slightly better, ideally a portable SSD drive if you don't plan to keep it in cold storage for prolonged periods of time.

gronostaj
  • 55,965
  • 20
  • 120
  • 179
  • Thank you, gronostaj. Files safely back on USB flash. Card was cheap, paint is already chipping around edges, & included adaptor's lock switch is very loose & prone to accidental activation. The issue of the sticky recovery files seems to be unrelated. It persists, but only on this computer. I've sent a bug report to the heroes who produce TED Notepad, so perhaps something will come of that. – Dade McDade Jan 06 '21 at 07:28
  • I've found the issue remains reproducible on trusted media including the laptop's eMMC drive, and may not be related to the card after all (sorry, I had to untick your answer as the solution!). The binary warning flashes up when I attempt to open a newly created or otherwise hitherto faultless text file into which a single character (or more) of the dark/ invisible code mentioned in the question has been copied and pasted from a 'corrupt' file. In this case, however, the 'good' contents of the file are shown, and the binary warning doesn't show anymore after the 'dark code' has been deleted. – Dade McDade Jan 06 '21 at 08:05
  • 1
    @Dade That's normal. Text editors guess if files are binary by looking for characters that wouldn't appear in a normal text file. You're pasting such character into a file, therefore triggering binary file detection. – gronostaj Jan 06 '21 at 14:02
  • Realised I have 3 separate issues. 1, bad media, the original cause (your answer reticked!). 2, dang foolery on my part: Had conflated 'Backup' with 'Auto-Save' in TedNPad, & must have idly checked the box in Settings to create backup files which duly started appearing everywhere, just as they're meant to. I figured this out myself & wrote again to jsimlo to apologise for my ignorance. They emailed most cordially to say the manual page has been updated 'to reflect this rather tiny difference'. A true champ. 3, what to do with my corrupt files - a question for another time. – Dade McDade Jan 26 '21 at 09:10