AppleScript名:Umlautを無視した文字列比較(NSDiacriticInsensitiveSearch) |
— Created 2015-03-28 by Shane Stanley use AppleScript version "2.4" use scripting additions use framework "Foundation" set aRes to compareIgnoringDiacriticals("AbC", "ÂbC") –> true set aRes to compareIgnoringDiacriticals("Abc", "Ábc") –> true set aRes to compareIgnoringDiacriticals("abc", "åbc") –> true –Strings Compare with ignoring Umlaut on compareIgnoringDiacriticals(aText as text, bText as text) set aStr to current application’s NSString’s stringWithString:aText return (aStr’s compare:bText options:((current application’s NSCaseInsensitiveSearch) + (current application’s NSDiacriticInsensitiveSearch as integer))) = current application’s NSOrderedSame end compareIgnoringDiacriticals |
More from my site
(Visited 17 times, 1 visits today)