FROM : Andrew Farmer
DATE : Sun Nov 28 02:03:08 2004
On 27 Nov 2004, at 15:40, Andrew Merenbach wrote:
> Good day, Hunter. Your code looks fine, but you should note that the
> method -[NSString cString] will, according too Apple's NSString class
> docs, be 'deprecated in the near future.' They instead recommend that
> one use 'UTF8String to convert arbitrary NSStrings to a lossless 8-bit
> representation.'
Except that if your input isn't UTF-8, -[NSString UTF8String] may give
you screwed-up results. -[NSString cString] has its place.
> On the other hand, you might not have to deal with C strings at all.
> If you read the data file into an NSString, you can use -[NSString
> rangeOfString:], as follows, as well as using an enumeration instead
> of checking for chars:
<snip>
Looks good to me.
DATE : Sun Nov 28 02:03:08 2004
On 27 Nov 2004, at 15:40, Andrew Merenbach wrote:
> Good day, Hunter. Your code looks fine, but you should note that the
> method -[NSString cString] will, according too Apple's NSString class
> docs, be 'deprecated in the near future.' They instead recommend that
> one use 'UTF8String to convert arbitrary NSStrings to a lossless 8-bit
> representation.'
Except that if your input isn't UTF-8, -[NSString UTF8String] may give
you screwed-up results. -[NSString cString] has its place.
> On the other hand, you might not have to deal with C strings at all.
> If you read the data file into an NSString, you can use -[NSString
> rangeOfString:], as follows, as well as using an enumeration instead
> of checking for chars:
<snip>
Looks good to me.
| Related mails | Author | Date |
|---|---|---|
| Craig Hunter | Nov 27, 18:43 | |
| Graham J Lee | Nov 27, 18:57 | |
| Andrew Merenbach | Nov 28, 00:40 | |
| Andrew Farmer | Nov 28, 02:03 | |
| mmalcolm crawford | Nov 28, 04:37 | |
| Mike S | Nov 29, 03:22 | |
| Fritz Anderson | Nov 29, 03:49 | |
| Craig Hunter | Nov 29, 05:29 | |
| heinrich.giesen | Nov 29, 10:36 |






Cocoa mail archive

