• 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: Reformatting a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reformatting a string


  • Subject: Re: Reformatting a string
  • From: KOENIG Yvan <email@hidden>
  • Date: Sat, 28 Jan 2012 12:21:39 +0100

Hello

It seems that for some of us, it's difficult to enter thr Unicode era.

(1) for years, ASCII number and ASCII character are deprecated
(2) he use of the functions "character id" and "id" is not sufficient to be UNICODE aware.

Here is a short piece of code which build a perfectly correct Unicode piece of text.

set texte to "Hello happy tax payers"
set texte2 to ""
repeat with unCarac in text of texte
set unID to id of unCarac
if (unID > 47) and unID < 127 then
set texte2 to texte2 & character id (65296 - 48 + unID)
else
set texte2 to texte2 & unCarac
end if
end repeat

I used it to build the original text in the different answers posted here.
Only three codes treated it correctly.

Using alphabetic order, they are :
the one triggering ASObjC Runner
the one triggering Python
the two triggering Satimage

The other ones rely on old habits : treating characters in the range id 48 thru 127.

No offense intend but given the origin of these three answers, it seems that only non US users take care to the fact that English spelling isn’t the only one used on earth.

Yvan KOENIG (VALLAURIS, France) samedi 28 janvier 2012 12:21:35


 _______________________________________________
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

  • Follow-Ups:
    • Re: Reformatting a string
      • From: Shane Stanley <email@hidden>
References: 
 >Reformatting a string (From: Angelo <email@hidden>)
 >Re: Reformatting a string (From: Michelle Steiner <email@hidden>)
 >Re: Reformatting a string (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: Reformatting a string
  • Next by Date: Re: Reformatting a string
  • Previous by thread: Re: Reformatting a string
  • Next by thread: Re: Reformatting a string
  • Index(es):
    • Date
    • Thread