Leave the charset encoding alone please
lalinsky at gmail.com
Wed Jun 6 09:57:47 UTC 2012
On Wed, Jun 6, 2012 at 10:08 AM, Yanhui Shen <shen.elf at gmail.com> wrote:
> Of course I know the ID3 spcification may also cover about the charset
> encoding issue.
> But its NOT the taglib's responsibility,
> all taglib need to do is to fetch the raw text data, store the raw text data
> provided by upper layer.
> So wchar_t is useless, wstring is useless, and even tstring.h & unicode.h is
> useless! char and std::string is enough for it.
No, std::string is not enough if you want to ensure integrity of the
files that TagLib saves. Different file formats save text differently,
and the only way to make it work is to have the Unicode representation
of the string.
I assume the reason why you want this is that you have MP3 files with
invalid ID3 tags, saying that the text is in Latin-1, while in fact
it's in some other local encoding. While it would be nice to have an
API in TagLib to repair such files, TagLib should never support
writting such invalid tags.
More information about the taglib-devel