Re: status of cString (was const char* to char*)
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.