This is killing me.

We have a snippet of code on a web page. Users copy the code to a text editor, make a small change, then copy the modified version and paste it into a terminal window.

And it fails to run.

I’ve confirmed this happens with both Textedit and Notes, and also that copying from the web page and pasting directly into a terminal works fine (although without the necessary code changes).

It’s something in the text editor copy; and there’s no way to either “copy as plaintext” or “paste without formatting” into a terminal.

Does anyone know how I can work around this?

EDIT Apparently some (but not all) spaces (octal 040) are being converted to octal “302 240”. I can’t figure out how to stop it!

  • RestrictedAccount@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    5 months ago

    I don’t know if this helps, but I saw/confirmed that if you edit plain text with text editor and try to open and execute Script Editor.app that it will compile and look ok, but not work. There is some sort of hidden metadata that are missing.