Length of string as UTF-8
Length of string as UTF-8
- Subject: Length of string as UTF-8
- From: Tom Robinson <email@hidden>
- Date: Sun, 6 Aug 2006 21:29:47 +1200
Hi people,
Is there a way to get the length of a Unicode string as it would be
represented in UTF-8?
I have an AppleScript which uses Unicode strings, which I then write
to a file. I need to keep the files under 4096 bytes for displaying
on an iPod.
e.g.:
set a to "don’t" as Unicode text -- that's a right single curly quote
log length of a -- This returns 5, but underlying AS it's probably 10
(the quote being U2019)
log length of (a as «class utf8») -- This still returns 5, but I'd
like something similar to this which returns 7 (the quote being UTF-8
e2 80 99)
Thoughts?
Cheers _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden