java - Stop IntelliJ code editor from escaping pasted string literal characters
问题描述
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?
解决方案
这是 IntelliJ IDEA 中的回归。有关详细信息,请参阅https://youtrack.jetbrains.com/issue/IDEA-278540。
推荐阅读
- java - Java 编码风格创建新的局部变量来引用类成员变量
- css - 如何在 React Native 中使用 flexbox 将一个项目居中?
- visual-studio - 从哪里下载 Visual Studio 2017 社区版?
- javascript - 将时间戳转换为日期并获取 HH:MM 格式
- matlab - 需要帮助调试梯形矩阵函数的代码
- powerbi - 在 Power BI 中的图表标题中嵌入测量列
- java - 如何将 ArrayList 中的对象实例与通过 Scanner 的用户输入进行比较
- angular - 图像在具有角度通用构建的 css 文件中的背景图像中加载了两次
- c++ - C++初学者使用while循环生成随机数
- python - Python:os.startswith 函数获得完全匹配