Re: Non-nil terminated C string to NSString
Re: Non-nil terminated C string to NSString
- Subject: Re: Non-nil terminated C string to NSString
- From: Ken Tozier <email@hidden>
- Date: Thu, 3 Aug 2006 03:12:47 -0400
On Aug 2, 2006, at 9:08 PM, John Stiles wrote:
Does initWithBytes:length:encoding: work for you?
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
Classes/NSString_Class/Reference/Reference.html#//apple_ref/occ/
instm/NSString/initWithBytes:length:encoding:
There appears to be a bug though in the complementary NSString
getCString:maxLength:encoding: method. It always replaces the first
character with zero if you use "NSUTF8StringEncoding." Just something
to be aware of if you need to get the strings back into C form.
I filed a bug report.
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden