• 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: status of cString (was const char* to char*)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: status of cString (was const char* to char*)


  • Subject: Re: status of cString (was const char* to char*)
  • From: Ali Ozer <email@hidden>
  • Date: Fri, 28 Nov 2003 01:20:47 -0800

Does anyone know what the official Apple policy is on the continued existence of lossyCString? Based on the documentation I've read, it is not being deprecated, and is proper way to get a C style string out of an NSString. It would be nice to have an official answer, though, especially since there seems to be a great deal of confusion regarding which cString methods are on the chopping block. What is the official Apple policy for getting and using cStrings from NSStrings (and where it is documented if there is)?

The problem with any method that uses defaultCStringEncoding implicitly (or explicitly) is that it behaves differently depending on the user's language. This "different" behavior turns out to be even more troublesome with encodings for bidirectional languages such as Hebrew and Arabic.

So, when we deprecate the "cString" methods in NSString, we will very likely deprecate any method which relies on defaultCStringEncoding, including lossyCString, and other methods such as stringWithContentsOfFile: and writeToFile:atomically:. If you do need to use the defaultCStringEncoding for some reason, you can still do so, by specifying the encoding explicitly.

It turns out that these days in X very few things need to use the defaultCStringEncoding, so this is the right direction.

Ali
_______________________________________________
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: 
 >const char* to char* (From: David Cairns <email@hidden>)
 >Re: const char* to char* (From: Prachi Gauriar <email@hidden>)
 >status of cString (was const char* to char*) (From: "Louis C. Sacha" <email@hidden>)
 >Re: status of cString (was const char* to char*) (From: "Louis C. Sacha" <email@hidden>)

  • Prev by Date: Re: Using gcc
  • Next by Date: System Preferences behaviour for NSToolbar
  • Previous by thread: Re: status of cString (was const char* to char*)
  • Next by thread: NSTableView in NSTabView(Item) update problem
  • Index(es):
    • Date
    • Thread