I am trying to write an AppleScript that will take the CD audio tracks reported by iTunes and encode them using a UNIX based encoder of my choice (e.g. Lame, OGG, FLAC etc). My program works great with regular non-unicode tracks. But if the CD audio tracks have names in unicode, the script fails.
It looks like the terminal does not support unicode. Instead you must somehow convert the unicode into a format that the Terminal needs.
For example, my script fails with the following CD album:
Name of Album: Dvořák: Symphony #9, Slavonic Dances
Name of Track: Dvořák: Slavonic Dance #2 In E, Op. 46/2
Here is a track reported in Finder or iTunes:
(Note: Mac OS X replaces : in the name with /)
Dvořák/ Symphony #9, Slavonic Dances:7 DvorÌŒaÌk/ Slavonic Dance #7 In C, Op. 46/7.aiff
But in Terminal, if you use “ls” you get:
/Volumes/Dvor\314\214a\314\201k:\ Symphony\ #9,\ Slavonic\ Dances/7\ Dvor\314\214a\314\201k:\ Slavonic\ Dance\ #7\ In\ C,\ Op.\ 46:7.aiff
Has anyone written a handler (or subroutine) that will convert unicode text into a format suitable for the Terminal (with all the escpae sequences).
In my case, since iTunes can give me the album name and track name in unicode, I would prefer to convert the actual name in unicode (not the name reported in the Finder) into a format suitable for the Terminal.
Any help would be greatly appreciated.
RobK
P.S. I am running Tiger 10.4.10
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)