• 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: cString deprecated!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cString deprecated!


  • Subject: Re: cString deprecated!
  • From: Owen Anderson <email@hidden>
  • Date: Mon, 2 Sep 2002 17:30:28 -0400

Is it just me, or does this seem like a perfectly rotten idea? the cString method is extremely useful when porting things from UNIX, or when writing wrappers around UNIX tools. I see their point about encodings, but there still needs to be some easy to use way to convert NSStrings to c strings and vice-versa.

Owen Anderson

On Monday, September 2, 2002, at 05:17 PM, Charles Srstka wrote:

Just wanted to provide a heads-up to anyone who didn't notice this
already in the Foundation release notes:

Expect -[NSString cString] method to be deprecated and removed from
public API at some point in the near future. This method was
originally introduced as a convenient way to bridge the gap between
NSStrings and original c-string APIs. However, this method is also
rather troublesome, as it works in the user's default encoding, which
is dependent on the user's language choice, and as it's not always
capable of converting arbitrary Unicode strings to 8-bit.

We recommend you go through and remove your usages of the cString
method from your code, in new versions of your apps or frameworks.
(Note that binary compatibility will be maintained as long as
appropriate --- we don't intend to break existing binaries which use
this method.)

The most common 8-bit encoding needed these days is the UTF-8
encoding, for which you can use the method UTF8String. For file system
strings, use fileSystemRepresentation (declared in NSPathUtilities.h).
_______________________________________________
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.
_______________________________________________
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: 
 >cString deprecated! (From: Charles Srstka <email@hidden>)

  • Prev by Date: How to grab everything in a string before a space?
  • Next by Date: Re: cString deprecated!
  • Previous by thread: cString deprecated!
  • Next by thread: Re: cString deprecated!
  • Index(es):
    • Date
    • Thread