Dependencies

It was tested against

Python 3.6 (on GNU/Linux)

python3-mutagen 1.39

python3-beautifulsoup4 4.6.0

Usage

Run this script against a music file (-f FILE), or a directory (-d DIR) of music files (it will be scanned recursively). Optionally, aid encoding detection by passing suspected encodings with -c CODEPAGE_1,CODEPAGE_2. If the script is not called with --dryrun, changes will be written immediately to the files, so beware.

Caveats

Encoding detection is not 100% accurate. In my tests, it was reasonably accurate with up to two encodings mixed together in a music library. Always use --dryrun first to spot problems. Consider unicodifying stubborn files or directories individually with the correct -codepage CODEPAGE and then running the script against your whole music library.

The script is not optimised for performance yet. It might waste more CPU than needed.