• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Producing Unicode-only characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Producing Unicode-only characters


  • Subject: Re: Producing Unicode-only characters
  • From: has <email@hidden>
  • Date: Tue, 25 Oct 2005 23:29:24 +0100

Nigel Garvey wrote:

>I can't find a really satisfactory way to get the number from the
>character, though there are two that are much faster than Chris's shell
>script.

For converting between unicode text and corresponding code points you could also use TextCommands, which provides good, non-hacky 'unicode characters' and 'unicode numbers' commands. Nice and fast on Panther and Tiger, though converting big strings is sluggish on Jaguar as older versions of the Apple Event Manager are dreadfully inefficient at packing large AELists. Examples:

- integer<->unicode conversion:

    unicode characters integerList
    --> unicode text

    unicode numbers unicodeText
    --> list of integer


- hex<->unicode conversion:

    convert to unicode (unpack hexString using hex encoding) from "utf16"
    --> Unicode text

    pack (convert from unicode unicodeText to "utf16") using hex encoding
    --> hex string (includes BOM)


The 'literal' and 'format' commands also allow unicode characters to be specified using %-escaped codes.

HTH

has
--
http://freespace.virgin.net/hamish.sanderson/
 _______________________________________________
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

  • Prev by Date: Re: Get Current cursor position in InDesign CS
  • Next by Date: Re: Producing Unicode-only characters [was: Finding \t, \r, \n reliably]
  • Previous by thread: Re: Producing Unicode-only characters
  • Next by thread: Re: Producing Unicode-only characters
  • Index(es):
    • Date
    • Thread