top | item 23337840

(no title)

caribousoup | 5 years ago

Beware: micro sometimes inserts invisible characters into your files. I never figured out why, and it seemed to only be on Debian.

I lost 2 days to troubleshooting weird problems, until less revealed some configs had little droppings of random text sprinkled throughout. I opened them with micro and everything looked fine... then I opened them with nano and I could see and remove the extra characters.

Micro has a great user interface, really. I wish that I could use it, but I don't think it's wise and I will stick with standard nano for quick edits.

discuss

order

rerx|5 years ago

Could those be non-breakable space characters? Alt+Space generates them in many environments. That caused a lot of grief on MacOS for me until I added a rule in Karabiner to disable the feature.

zyedidia|5 years ago

Do you remember what version that issue happened on? Were you using unicode characters or a non-UTF8 encoding? That sounds like an annoying issue and it would be great to fix it.

caribousoup|5 years ago

This was in 2018, not sure which version. UTF-8 across the board.

I don't remember the details, unfortunately. I think there was a pattern to it, like they were control characters or something. But it silently inserted them, and they were not visible within the editor, but they were visible in nano/less/etc.

bildung|5 years ago

Have you tried out ne, the nice editor? Also packaged in Debian for quite a while, has syntax highlighting, ctrl+s saves a file etc.

dartharva|5 years ago

I observed the reverse on Windows. A Powershell profile file edited on vscode, when opened on micro, shows an invisible character (I thought it was space) after every character in it.

aktau|5 years ago

That just sounds like a UTF-16 encoded file, which is common on Windows AFAIK. Every second character would be a NUL byte.

Perhaps micro doesn't autodetect encoding? Or you forced it to utf-8?