• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to insert special characters in strings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >how to insert special characters in strings? (From: Luc Vandal <email@hidden>)

  • Prev by Date: Re: Window move unknown to NSApp?
  • Next by Date: First day of week?
  • Previous by thread: Re: how to insert special characters in strings?
  • Next by thread: Re: how to insert special characters in strings?
  • Index(es):
    • Date
    • Thread