Exposing TagLib::String type?

Mark 'Mook' Yen mook at songbirdnest.com
Fri Sep 19 23:39:39 CEST 2008


Hello,

First, thanks for TagLib, it makes dealing with metadata a bit easier.

TagLib::String can be constructed from various forms of Unicode, or via 
a Latin1 string.  In practice, this Latin1 string is really just a 
random sequence of octets, since existing media players do not obey the 
specs.  Would it be possible for the string to remember what 
String::Type the string was constructed with, and expose it to the 
hosting app to deal with the bad encoding as it sees fit?  TagLib itself 
really can't deal with it (it has no ability to, for example, bring up 
UI).  This of course would not be useful in certain situations (such as 
concatenating a Latin1 string to a real Unicode string), but that can't 
be avoided.

While ID3v1 allows the use of a StringHandler, it is inadequate as I 
believe (in my case, at least) character set detection works better 
given multiple tags within the same file (and therefore assuming no more 
than one charset is used per file).  So far it seems to work pretty 
well, even if not perfect.

If this seems desirable, I should be able to whip up a patch pretty 
quickly, but I am uncertain I will be able to correctly maintain ABI 
compatibility.  Any comments are, of course, welcome.

-- 
Mark 'Mook' Yen
mook at songbirdnest


More information about the taglib-devel mailing list