Re: how to insert special characters in strings?
Re: how to insert special characters in strings?
- Subject: Re: how to insert special characters in strings?
- From: Bertrand Landry Hetu <email@hidden>
- Date: Wed, 2 Mar 2005 12:00:09 -0800
Hi Luc,
You'd have to use UT8 encodings. To find out the code I used the "Special Characters" function in the terminal app. It will output the octal values for the character you want.
in this case command returned "\342\214\230". I then converted those values to hex and used this:
const char * string = "\xE2\x8C\x98";
NSString * testString = [NSString stringWithUTF8String: string];
Now I tried finding a way with @"" strings but it wouldn't work. So I'm not sure what encoding it is expecting.
On 02 mars 2005, at 11:33, Luc Vandal wrote:
I know this is not really cocoa related, but does anyone know how to insert special characters *such as the Command symbol) in strings (NSString, char, etc.). Can I use the escape character '\'? Can I use ASCII or do I have to use Unicode?
Thanks!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden