Shell script statement works in Terminal, fails in Hazel

I have written a shell script that
1) reads the comment tag from an MP3 file with ExifTool
2) converts the MP3 to a different format with ffmpeg
3) writes back the comment to the new mp3 with eyeD3 with the line
This works perfectly when running it in Terminal or in CodeRunner.
However, when using it as an external script in a Hazel rule and applying it to the same MP3 file, the "eyeD3" command line fails with the error
I am puzzled why running the script through Hazel would seem to influence string encoding?
1) reads the comment tag from an MP3 file with ExifTool
2) converts the MP3 to a different format with ffmpeg
3) writes back the comment to the new mp3 with eyeD3 with the line
- Code: Select all
/usr/local/bin/eyed3 --encoding utf8 --v2 --comment "$sMP3TagComment" "$sOriginalDateiname"
This works perfectly when running it in Terminal or in CodeRunner.
However, when using it as an external script in a Hazel rule and applying it to the same MP3 file, the "eyeD3" command line fails with the error
- Code: Select all
eyeD3: error: argument -c/--comment: invalid UnicodeArg value: 'eyeD3: error: argument -c/--comment: invalid UnicodeArg value: '1. Unerm\xc3\xbcdlich, engagiert und streitbar - Bischof Erwin Kr\xc3\xa4utler im Gespr\xc3\xa4ch.'
I am puzzled why running the script through Hazel would seem to influence string encoding?