On Apr 3, 2015, at 11:19 , Marco S Hyman <m...@snafu.org> wrote:
> 
> The original code will return true only if all code points map to white space.

The “failure” I was talking about is something a bit different. It has two 
problems:

1. For Unicode code points that are represented by 2 code values, it tests the 
code values, not the code points. That’s wrong.

2. For graphemes that are represented by 2 or more code points, it still tests 
the code values, of which there could be 4 or more per grapheme. That’s also 
wrong. With the ‘for char in String (self)’ code, if you tested whether a 
decomposed acuteA was in the (7-bit) ASCII character set, you’d get the answer 
“YES".

You could mitigate #1 by using UTF-32 code values instead of UTF-16, but that 
wouldn’t help with #2.



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to