0

我有这个 AppleScript,它返回 iTunes 中当前正在播放的艺术家的名字。不幸的是,如果艺术家姓名包含特殊字符,如 ú,则会输出奇怪的字符。我怎样才能解决这个问题?

tell application "iTunes"
    if player state is playing then
        try
            set myTrack to artist of current track
        on error
            return ""
        end try
        return myTrack
    end if
end tell
4

1 回答 1

0

Unicode 字符通常不会导致任何问题:

tell application "iTunes" to tell current track
    set name to "あ"
    name -- あ
end tell

您的某些文件的 ID3 标记可能有一些非 Unicode 编码。我不知道如何处理 AppleScript 中的问题,但您可以尝试将标签转换为 UTF-8 吗?请参阅https://superuser.com/questions/90449/repair-encoding-of-id3-tagshttp://code.google.com/p/id3-to-unicode/

于 2012-08-04T21:06:57.200 回答