i’m trying to read ID3 frames and their values with TagLib (1) and index them with CLucene (2). the former returns frame ID’s as std::vector<char> (3) and the latter writes field names as tchar* [wchar_t* in Linux] (4). i need to make a link between the two. how can i convert from std::vector<char> to wchar_t* by means of the STL? thank you
(1)http://developer.kde.org/~wheeler/taglib.html
(2)http://clucene.sourceforge.net/
(3)http://developer.kde.org/~wheeler/taglib/api/classTagLib_1_1ID3v2_1_1Frame.html#6aac53ec5893fd15164cd22c6bdb5dfd
(4)http://ohnopublishing.net/doc/clucene-0.9.21b/html/classlucene_1_1document_1_1Field.html#59b0082e2ade8c78a51a64fe99e684b2
In a simple case where your
chars don’t contain any accented characters or anything like that, you can just copy each one to the destination and use it:My guess is that for ID3 frame ID’s you don’t have accented characters and such, so that’ll probably be all you need. If you do have a possibility of accented characters and such, things get more complex in a hurry — you’ll need to convert from something like ISO 8859-x to (probably) UTF-16 Unicode. To do that, you need a code-page that tells you how to interpret the input (i.e., there are several varieties of ISO 8859, and one for French input will be different from one for Russian, for example).