• 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: Getting Info from the Finder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting Info from the Finder


  • Subject: Re: Getting Info from the Finder
  • From: Thomas Fischer <email@hidden>
  • Date: Thu, 20 May 2010 13:57:56 +0200

Hi Mark any Tommy,

Am 19.05.2010 um 17:42 schrieb Mark J. Reed:

> On Wed, May 19, 2010 at 11:09 AM, Thomas Fischer <email@hidden> wrote:
>> Hi Mark,
>> I didn't find any way to evaluate \U00A9 directly, but at least I can
>> convert from hex number X to decimal number Z using
>> do shell script ("printf \"%d\" 0x" & X)
>> Unfortunately, printf seams to be completely unaware not only of Unicode,
>> but of any characters beyond ASCII 127:
>> e.g.
>> printf "%b" "\x7e" -> ~
>> but
>> printf "%b" "\xe4" -> ?
>
> Well, that outputs exactly what you asked for - the one-byte value
> 0xe4.

I would expect
	printf "%b" "\x3f" -> ?

the sign "?" as indicator for non identified character is a little problematic.

> Which would work if you were using a one-byte character set
> like Latin-1 or MacRoman.  But for Unicode it doesn't work.

I think it is a sign of shortcomings on the side of the shell.
If my text editor required to type "ä" every time I need an "ä", I would discard it quickly.
But this is exactly what the shell does:
	printf "%b" "\xC3\xA4" -> ä
There are other shells, which behave better, e.g. the Z shell zsh:
printf "%b" "\u00E4\n" -> ä

(Without the \n zsh creates some very strange output, something like dozens of spaces stacked on top of each other.)
or for that matter even easier:
	print "\u00E4" -> ä
You can obtain this result from the standard shell using e.g.
	echo 'print \"TeX \\U00A9 output 2008.01.24\"'|zsh ->
	"TeX © output 2008.01.24"
So I thought I was home free, but alas:
	do shell script "echo 'print \"TeX \\U00A9 output 2008.01.24\"'|zsh" ->
	"TeX "
Everything from the \U00A9 onward vanishes!

So I keep on looking for better solutions.
Tommy's hint didn't seem to work for me.

Thomas





 _______________________________________________
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: Getting Info from the Finder
      • From: Tommy Bollman <email@hidden>
    • Re: Getting Info from the Finder
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Getting Info from the Finder (From: Thomas Fischer <email@hidden>)
 >Re: Getting Info from the Finder (From: Martin Michel <email@hidden>)
 >Re: Getting Info from the Finder (From: Thomas Fischer <email@hidden>)
 >Re: Getting Info from the Finder (From: Luther Fuller <email@hidden>)
 >Re: Getting Info from the Finder (From: Thomas Fischer <email@hidden>)
 >Re: Getting Info from the Finder (From: Tommy Bollman <email@hidden>)
 >Re: Getting Info from the Finder (From: "Mark J. Reed" <email@hidden>)
 >Re: Getting Info from the Finder (From: Thomas Fischer <email@hidden>)
 >Re: Getting Info from the Finder (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Tell application variable for remote service
  • Next by Date: Re: Tell application variable for remote service
  • Previous by thread: Re: Getting Info from the Finder
  • Next by thread: Re: Getting Info from the Finder
  • Index(es):
    • Date
    • Thread