• 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: @Strings and strings in C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @Strings and strings in C


  • Subject: Re: @Strings and strings in C
  • From: Chris Hanson <email@hidden>
  • Date: Sun, 29 Jun 2003 16:53:14 -0700

On Sunday, June 29, 2003, at 07:43 AM, M. Uli Kusterer wrote:
const char* str = [[NSString stringWithString:@"Hello"] cString];

There's also UTF8string, I think, in case you need UTF8 instead of whatever cString gives you (ASCII, probably).

You should never use cString, because the encoding of the string returned by cString isn't guaranteed to be consistent.

UTF8String will always give you a C-style string in UTF-8 encoding, and UTF-8 can represent all languages supported by Mac OS X even when mixed.

-- Chris

--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: @Strings and strings in C (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Re: Writing Files
  • Next by Date: subclass weirdness
  • Previous by thread: Re: @Strings and strings in C
  • Next by thread: Re: @Strings and strings in C
  • Index(es):
    • Date
    • Thread