• 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: Applescript and characters accented in a path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript and characters accented in a path


  • Subject: Re: Applescript and characters accented in a path
  • From: John Delacour <email@hidden>
  • Date: Mon, 1 Sep 2003 23:54:03 +0100
  • Mac-eudora-version: 6.1a1

At 11:01 pm +0200 1/9/03, Jean-Baptiste LE STANG wrote:

Mac OS X uses Unicode. You must express all paths as 'Unicode text' and not as 'string'. Strings are only the same as Unicode (utf-8) if they contain only 7-bit characters.

So maybe you can try the following :


set f to path to desktop
set f to (f as Unicode text) as alias

You will not get the problem if you write

set f to path to desktop as Unicode text
set f to alias f


So there is a workaround, but this does seem to be a bug.


However, this will not work if there are Unicode characters in the pathname, for the reason I mentioned:

set f to path to desktop as string
set f to alias f


To remove any doubt, it's best to experiment with a pathname that simply cannot be converted to a string. This script will create such a file and you will see in the result {the decomposed filename, the filename in UTF-8}:


do shell script "perl -e '
$f = qq~$ENV{HOME}/Desktop/Syst\\x{1f72}me.txt~ ;
open F, qq~>$f~ ;
print $f;'"
set f to POSIX file result as Unicode text
{f, alias f}


JD
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Fwd: Applescript and characters accented in a path (From: Jean-Baptiste LE STANG <email@hidden>)

  • Prev by Date: Re: Applescript and characters accented in a path
  • Next by Date: Re: Fetch
  • Previous by thread: Re: Applescript and characters accented in a path
  • Next by thread: Fetch
  • Index(es):
    • Date
    • Thread