Stop IntelliJ code editor from escaping pasted string literal characters

Viewed 288

What I want:

String x = "" ;

What I get in Apple TextEdit 1.16 text editor app when clicking from the macOS "Show Emojis & Symbols" floating windoid:

String x = "" ;

Problem 1

What I get in IntelliJ 2021.2.2 code editor when clicking from the macOS "Show Emojis & Symbols" floating windoid:

String x = "ð" ;

Update: This appears to be a currently known bug. See issue page IDEA-278540 Emoji in OSX are rendered as another unicode, as noted in Answer by Konstantin Annikov.

Problem 2

What I get in IntelliJ 2021.2.2 code editor when pasting that character copied from TextEdit app:

String x = "\uD83D\uDE37" ;

Presumably the issue revolves around Unicode characters outside the Basic Multilingual Plane.

➯ Is there any way to make the IntelliJ code editor accept such characters directly, without escaping?

2 Answers

Use Edit | Paste | Paste as Plain Text to paste without any escaping.

Related