tags:

views:

295

answers:

3
+2  Q: 

NSString problem

How can i convert Special character of \u0097 this into nsstring ....

THanks in advance

+2  A: 

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.

weichsel
A: 

Hi drvdijk......

I am using your code NSString *aString = [NSString stringWithUTF8String:"Some text\u0097"];

compile this and error occured

error:\u0097 is not a valid universal character

Any idea?..Thanks

A: 

Try

[NSString stringWithUTF8String:"Some text-"]

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

IlDan