Re: special characters are destroyed when copying a string character by character
Re: special characters are destroyed when copying a string character by character
- Subject: Re: special characters are destroyed when copying a string character by character
- From: Kyle Sluder <email@hidden>
- Date: Tue, 05 Apr 2011 21:39:18 -0700
On Tue, Apr 5, 2011 at 9:31 PM, Kyle Sluder <email@hidden> wrote:
> On Tue, Apr 5, 2011 at 8:55 AM, Horst Jäger <email@hidden> wrote:
>> Any idea why?
>
> Because "unichar" is not the same thing as a grapheme.
>
> http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Strings/Articles/stringsClusters.html#//apple_ref/doc/uid/TP40008025-SW1
And now reading your code again it's clear that Sherm's certainly more
correct than me… but even though a direct unichar-by-unichar should
work (and Sherm points out that your use of %c means you're not
copying unichars, hence your scrambling), the hairs on your neck
should prick up if you find yourself blindly enumerating unichars.
--Kyle Sluder
_______________________________________________
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