Re: Coercing ligatures to expanded characters
Re: Coercing ligatures to expanded characters
- Subject: Re: Coercing ligatures to expanded characters
- From: has <email@hidden>
- Date: Fri, 13 Jan 2017 00:44:01 +0000
Jacob M. Small wrote:
I need to find a way to coerce all ligatures out of strings. Does anyone
know a method to do this or have a link to something ready-made?
Look at NSString's stringByFoldingWithOptions:locale:. It's already
wrapped by the `transform text` command of the Text library I wrote last
year:
https://github.com/hhas/applescript-stdlib
I don't think I included a constant specifically for ligatures, in which
case rummage around the documentation for
-stringByFoldingWithOptions:locale: and the ICU project's normalization
library (which IIRC is what the ObjC method wraps) and you'll probably
find something appropriate.
HTH
has
p.s. Don't even bother attempting to roll your own vanilla-AppleScript
code for normalizing Unicode text. If you don't already know how much
expert knowledge and hard work is needed to get it right then you are
*not qualified* to do it, while if you do already know then you will
*not want* to do it. Plus, either way, the AppleScript language is
utterly unfit and worse than useless for writing high-volume/low-level
text-processing code (and this is both).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden