Re: How to Do This Without Smile or Satimage
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