Re: string encoding in NSMutableData
Re: string encoding in NSMutableData
- Subject: Re: string encoding in NSMutableData
- From: "Paolo Manna" <email@hidden>
- Date: Wed, 8 Aug 2007 17:42:37 +0100
On 08/08/07, Paolo Manna <email@hidden> wrote:
> > output = [NSMutableData dataWithBytes:[key cStringUsingEncoding: NSUnicodeStringEncoding]
> > length:4];
> Not knowing what you're using your data for, if you want to get 1 byte
> for each character you input, you'd better use something like
> NSASCIIStringEncoding: it's lossy anyway, but in a predictable way.
Correcting myself: DO NOT use cStringUsingEncoding: for conversions,
because it will not deal with lossy ones, I was actually referring to
dataUsingEncoding:allowLossyConversion:
Paolo
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden