我写一个文本编辑器,它有一个选项来显示一个项目符号,代替任何不可见的Unicode字符。不幸的是,似乎没有简单的方法来确定Unicode字符是否是不可见的。
I am writing a text editor which has an option to display a bullet in place of any invisible Unicode character. Unfortunately there appears to be no easy way to determine whether a Unicode character is invisible.
我需要找到一个包含每个Unicode字符的文本文件,对于不可见字符。
I need to find a text file containing every Unicode character in order that I can look through for invisible characters. Would anyone know where I can find such a file?
编辑:我在Cocoa for Mac OS X中编写这个应用程序。
I am writing this app in Cocoa for Mac OS X.
推荐答案哦,我看到...实际的隐藏字符;)这个FAQ可能是有用的:
Oh, I see... actual invisble characters ;) This FAQ will probably be useful:
a href =www.unicode/faq/unsup_char.html =nofollow noreferrer> www.unicode/faq/unsup_char.html
www.unicode/faq/unsup_char.html
它列出了当前不可见的编码点,并有其他可能有帮助的信息。
It lists the current invisible codepoints and has other information that you might find helpful.
编辑:特定信息
由于您使用的是Cocoa,您可以获取控制字符的unicode字符集,并进行比较:
Since you're using Cocoa, you can get the unicode character set for control characters and compare against that:
NSCharacterSet* controlChars = [NSCharacterSet controlCharacterSet];您可能还想看看我在上面发布的FAQ链接,认为您可能需要根据控制字符集返回的字符集的信息。
You might also want to take a look at the FAQ link I posted above and add any characters that you think you may need based on the information there to the character set returned by controlCharacterSet.
编辑:添加了一个从Unicode字符创建Unicode字符串的示例
unichar theChar = 0x000D; NSString* thestring = [NSStirng stringWithCharacters:&theChar length:1];更多推荐
确定Unicode字符是否可见?
发布评论