Taglib + Unicode

Lukáš Lalinský lalinsky at gmail.com
Sat Mar 5 09:00:02 CET 2011


On Sat, Mar 5, 2011 at 6:03 AM, Jeremy Gregorio
<jeremy.firefox.addon at gmail.com> wrote:
> Hi all,
>
> I wrote a simple tagging function trying to make a v2 tag, like so:
>
> //The following includes are to make the ID3v2 stuff compile...
> #include "id3v2tag.h"
> #include "mpegfile.h"
> #include <tlist.h>
> #include <fileref.h>
> #include <tfile.h>
> #include <tag.h>
>
> Tag(const wchar_t *path, const wchar_t *title, const wchar_t *artist, const
> wchar_t *album, const wchar_t *comment, const wchar_t *genre, const wchar_t
> *year, const wchar_t *track)
> {// Function takes 8 parameters.
>
>     TagLib::FileName fs(path);
>     TagLib::MPEG::File f(fs);
>
>     TagLib::ID3v2::Tag *t = f.ID3v2Tag(true);
>     TagLib::String tlTitle(title);
>     t->setTitle(tlTitle);
>     f.save();
>
> }//END FUNCTION TAG
>
> But it only creates ID3v1 tags, and so if there are unicode characters (like
> Japanese, Korean, Chinese, etc), it can't/doesn't write the tag.
>
> How do I force a v2 tag to be written? If I do, will the Unicode characters
> work?

How do you check what tags are written in the file? ID3v2 tags should
be always written. Unicode should also work fine, what problems do you
see? Is there garbage in the tag, are the tags not saved at all?

Lukas


More information about the taglib-devel mailing list