Re: Find with Nonspacing_Mark
Re: Find with Nonspacing_Mark
- Subject: Re: Find with Nonspacing_Mark
- From: Aki Inoue <email@hidden>
- Date: Sun, 28 Dec 2008 23:46:43 -0800
The standard operation here is to always match characters at the
grapheme cluster boundaries.
Since SARA U is a non-spacing mark, we don't allow partial matching.
Trying to cause partial matching, even for Thai/Indic/Hebrew/Arabic
scripts that some of non-spacing marks are vowels, is cosidered a good
UI since it's harder for users to determine the paritiel selection
within a graphic element.
If you really need to do the partial matching, specifying
NSLiteralSearch flag allows it.
Aki from iPhone
On 2008/12/28, at 21:39, "Gerriet M. Denkmann" <email@hidden>
wrote:
On 29 Dec 2008, at 03:02, "Gerriet M. Denkmann"
<email@hidden> wrote:
I have a NSTextView which contains "บุ" that is: THAI CHARACTER
BO
BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a
vowel.
When I use the Find Panel to search for "บ" (using "Contains" or:
"Starts with") nothing is found.
Same in TextEdit; same with any character + Nonspacing_Mark.
When I enter "a" + COMBINING DIAERESIS and search for "ä" (LATIN S
MALL
LETTER A WITH DIAERESIS) the character, which looks like "ä" is fo
und.
Searching for "a" does not find it.
This makes some sense.
But to treat "นุ" as one letter is just plain silly and quite wro
ng.
How can I tell the Find Panel (or the NSTextView) to find my
characters, even if they are followed by some other character?
10.5.6
I tried this:
NSString *bu = @"บุ";
NSString *ba = @"บ";
NSRange ra = [ bu rangeOfString: ba ];
if ( ra.location == NSNotFound )
{
NSLog(@"%s There is no \"%@\" in \"%@\"",__FUNCTION__, ba, bu );
}
else
{
NSLog(@"%s range of \"%@\" in \"%@\" is %@",__FUNCTION__, ba, bu,
NSStringFromRange(ra));
};
and got the answer:
There is no "บ" in "บุ"
which somehow boggles my mind (might be a problem of aforementioned
mind though).
What do I do now: write my own version of rangeOfString: ? I would
rather like to avoid this.
Kind regards,
Gerriet.
_______________________________________________
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
_______________________________________________
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