
Hope this helps you narrow down the problem. This _could_ be a bug in Postico (as you said above) but I just tried to copy html from safari and paste it in Postico and no nbsp appeared. Modern browsers support many of these symbols, so you should be able to copy and paste the formatted text into Facebook, Twitter, Instagram, Tumblr, and other social media posts and statuses. Generated Invisible Ink text is the set of the Unicode symbols.
#INVISIBLE CHARACTER COPY AND PAIST GENERATOR#
To reproduce: copy some code from Visual Studio Code paste it in Postico (I had the same problem with other editors, may be Xcode itself, but this is what I'm using now) copy from Postico paste in a file (or in textmate) read the file with an hex-editor to find the nbsp characters. Invisible Ink Text Generator is an online tool that converts normal text into Invisible Ink letters. This breaks some program, while others seems to convert to spaces (textmate). I was able to track back that in the pasted clipboard spaces in code are substituted by the sequence c2a0 (that's utf-8 for the non-breaking space character).

I had the same problem of pasting code from Code behaving strangely in other programs.
#INVISIBLE CHARACTER COPY AND PAIST MAC#
It's also not going to fix this problem for all the other Mac apps out there.Īnyway, the problem is that AppKit prefers HTML to plain text when pasting into a rich text field.

Since VS Code is popular we'll probably do that, but it's a less than perfect workaround, since it changes a few other behaviors, which we'll have to find some additional workarounds for. If I change the text field type to richText = NO, then pasting works correctly. It happens with every app that uses a standard Cocoa NSTextField configured for rich text. If people copy-paste text from VS Code to Mail, they'll end up with the wrong type of spaces.
