Re: Best Way to Append Bytes With Encoding To CFMutableString
Re: Best Way to Append Bytes With Encoding To CFMutableString
- Subject: Re: Best Way to Append Bytes With Encoding To CFMutableString
- From: "email@hidden" <email@hidden>
- Date: Wed, 28 Mar 2012 15:55:55 +0100
On 28 Mar 2012, at 15:35, Andreas Grosam wrote:
>
> On Mar 28, 2012, at 3:58 PM, email@hidden wrote:
>>>
>> I presume that you considered CFStringAppendCString():
>>
>> void CFStringAppendCString (
>> CFMutableStringRef theString,
>> const char *cStr,
>> CFStringEncoding encoding
>> );
>>
>
>
> Yes, but:
>
> Can I use any code-unit, even so the function indicates that only "char" is allowed? What, if I have uint32_t or uint16_t code-unit types? (I guess, I can use them anyway after a type cast.) The description is not clear about this, though.
The fact that the function supports encoding presumably entails support for non char code-unit types.
If not, this is a pretty sterile function.
>
> Also, consider that Unicode NULL (U+0000) is a regular character in Unicode - which conflicts with C strings which shall be zero terminated.
A valid point. I don't know how the Unicode NULL is generally used in practice.
>
> So, strictly, I do NOT have C strings.
That was what I suspected.
Regards
Jonathan Mitchell
Mugginsoft LLP
_______________________________________________
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