Re: @Strings and strings in C
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.