• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: special characters are destroyed when copying a string character by character
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >special characters are destroyed when copying a string character by character (From: Horst Jäger <email@hidden>)
 >Re: special characters are destroyed when copying a string character by character (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: special characters are destroyed when copying a string character by character
  • Next by Date: ScrollView Programming
  • Previous by thread: Re: special characters are destroyed when copying a string character by character
  • Next by thread: ScrollView Programming
  • Index(es):
    • Date
    • Thread