简体   繁体   中英

How can I convert the special character \u0097 into NsString?

如何将特殊字符转换为NsString?

You can try the following:

const unichar cStringArray[] = { 0x0097, 0};
NSString* tmp = [NSString stringWithCharacters:cStringArray length:sizeof cStringArray / sizeof *cStringArray];

I tried the above code and bound the resulting string to a NSTextField.
The textfield did not display any character. What glyph are you expecting?
http://www.fileformat.info/info/unicode/char/0097/index.htm shows a hyphen.

Try

[NSString stringWithUTF8String:"Some text-"] 

where the '-' is your character entered with the Special Characters Panel ⌥⌘T

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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