• 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: How to Do This Without Smile or Satimage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to Do This Without Smile or Satimage


  • Subject: Re: How to Do This Without Smile or Satimage
  • From: Axel Luttgens <email@hidden>
  • Date: Thu, 01 Mar 2012 12:51:27 +0100

Le 1 mars 2012 Γ  01:27, Christopher Stone a Γ©crit :

> On Feb 28, 2012, at 21:47, Shane Stanley wrote:
>> On 28/02/2012, at 11:53 PM, Alex Zavatone wrote:
>>
>>> Awk works from what I remember.
>>
>>> Here are some sed commands
>>
>> Are they both Unicode-aware?
> ______________________________________________________________________
>
> I believe that neither one is directly.

According to its man page, sed(1) should take LANG and LC_* environment variables into account.
On the other hand, "do shell script" defaults to the C locale.
So, let's try (Lion here) :

	set myText to "This 😝😝😝 is 😣😷😝 an 😣😷 experiment.😝"
	set cmd to "LANG=fr_FR.UTF-8 sed 's/😝😝*//g' <<< " & quoted form of myText
	do shell script cmd
	--> "This  is 😣😷 an 😣😷 experiment."

The man page thus seems to tell the truth.

As far as awk(1) is concerned, its man page is silent about such matters.
And there must be a good reason:

	set myText to "😝😝😝"
	set cmd to "LANG=fr_FR.UTF-8 awk '{print length($0)}' <<< " & quoted form of myText
	do shell script cmd
	--> "12"

Axel


 _______________________________________________
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: How to Do This Without Smile or Satimage
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: Opening Folders in Lion
  • Next by Date: Wanted: A Text View for AppleScript
  • Previous by thread: Re: Opening Folders in Lion
  • Next by thread: Re: How to Do This Without Smile or Satimage
  • Index(es):
    • Date
    • Thread