Taglib + Unicode

Jeremy Gregorio jeremy.firefox.addon at gmail.com
Sat Mar 5 06:03:21 CET 2011


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/taglib-devel/attachments/20110304/1c56b134/attachment.htm 


More information about the taglib-devel mailing list