I use several modes that display Unicode characters in my code without changing the underlying file. For example, in Haskell mode, the following code:
foo :: forall a. Eq a => a -> a -> a
gets displayed as
foo ∷ ∀ a. Eq a ⇒ a → a → a
This is implemented with
compose-region, which can replace a region with a character without changing the actual buffer text.
When I copy the code, however, it copies the underlying text without the Unicode. Most of the time this is the desired behavior, but sometimes I want to copy the displayed characters instead—I had to type up the second version of my example myself!
How can I copy the result of character substitutions like this rather than the underlying text? (In fact, I'm not sure this is possible at all!)