Does anyone know of a tool or have example code that show what
character encoding is used inside id3 tags?

I've seen very little documentation about the proper use of character
sets in id3 tags. From my understanding, id3v1 tags should always
be encoded using iso8859-1. id3v2 tags can be encoded as iso8859-1,
utf-8 or utf-16. The character encoding should be stored somewhere,
so a decode knows how to interpret the data. Please correct me if
these assumptions are wrong.

Now that Samba 3 is finally out (well, it's a release candidate), I can
finally use UTF-8 encoded filenames on Linux and display them
right in Windows. Changing the filenames from iso8859-1 encoded
names to UTF-8 involved converting all my cached CDDB data to
UTF-8 and rerunning all my tunes through my ripper. This not only
changed the names, but also retagged the tunes. The tunes now
have UTF-8 encoded tags, but now several clients are corrupting
the tags, as they do another iso8859-1 to UTF-8 translation.

This makes me suspicious about my ripper. It may be using UTF-8
encoded tags but storing them as if they are iso8859-1 encoded.

Unfortunately, I have not been able to find any tool showing these
properties, and libid3tag, which I use for mp3tofid just hides
all this mess and offers the tags UCS-4 encoded.

Pim