Best Way to Append Bytes With Encoding To CFMutableString
Best Way to Append Bytes With Encoding To CFMutableString
- Subject: Best Way to Append Bytes With Encoding To CFMutableString
- From: Andreas Grosam <email@hidden>
- Date: Wed, 28 Mar 2012 15:35:35 +0200
What's the preferred method to append a sequence of bytes in encoding 'encoding' (a CFStringEncoding) to a CFMutableString object?
Well, the set of encodings which I'm interested in are the Unicode encoding schemes (UTF-8, UTF-16, UTF-16LE, UTF-16BE, etc)
Unfortunately, there is no CFStringAppendBytes() function where I could specify the encoding.
So, the way which I think is efficient, is:
CFStringRef tmp = CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, bytes, numBytes, encoding, NO, kCFAllocatorNull);
CFStringAppend(myMutableString, tmp);
CFRelease(tmp);
Is there any better method?
Thanks on advance for tips!
Regards
Andreas
_______________________________________________
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