• 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
Applescript UTF-8 and do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Applescript UTF-8 and do shell script


  • Subject: Applescript UTF-8 and do shell script
  • From: John Mistler <email@hidden>
  • Date: Thu, 30 Jul 2009 18:44:54 -0700

I have been told that Applescript 2.2.1 is fully UTF-8 compliant.  Can anyone explain why I am having the following results?

When scripting applications, like:

tell application "iTunes" to set theArtist to artist of track 1 of playlist "TestUTF8" -- theArtist = Beyoncé
do shell script "touch ~/Desktop/result.txt"
do shell script "echo " & theArtist & " >> ~/Desktop/result.txt"
--> result.txt file contains a garbled character --> Beyonc√©

tell application "TextEdit" to set theArtist to word 1 of paragraph 1 of document 1 -- theArtist = Beyoncé
do shell script "touch ~/Desktop/result.txt"
do shell script "echo " & theArtist & " >> ~/Desktop/result.txt"
--> result.txt file contains a garbled character --> Beyonc√©

What happened to that UTF-8 special character when writing out to the file?

Thanks,

John Mistler
 _______________________________________________
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: Applescript UTF-8 and do shell script
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Scripting Filepaths
  • Next by Date: Re: Applescript UTF-8 and do shell script
  • Previous by thread: Re: Automating authorization dialog boxes for keychain certificate permission changes
  • Next by thread: Re: Applescript UTF-8 and do shell script
  • Index(es):
    • Date
    • Thread