简体   繁体   English

字符串文字中的Swift特殊Unicode字符

[英]Swift Special Unicode Characters in String Literals

Am trying to do the experiment the following in Swift, as its written in apple developer documentation: let encircledLetter: Character = "i\\u{20DD}" 我试图在Swift中进行以下实验,正如它在Apple开发者文档中所写的那样: let encircledLetter: Character = "i\\u{20DD}"

But unfortunately the compiler is giving an error 但遗憾的是编译器发出错误

\u escape sequence expects 4 hex digits to follow it 

I am totally new in Swift so I don't know if I missed something here 我是Swift的全新人,所以我不知道我是否错过了这里的一些东西

The problem is you are still using the Beta version of Xcode. 问题是您仍在使用Xcode的Beta版本。 Upgrade it to the latest one and the problem will go away. 将其升级到最新版本,问题就会消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM