Thanks so much Michael. That's exactly what was needed, straight ASCII conversion.<br><br>This is what works:<br><br>QString qstr = "/home/mydir/music/song.mp3";<br>TagLib::FileRef tagFile(qstr.toAscii());<br>
<br>Apologies, I didn't take note of the toAscii() function.<br><br>Regards,<br>Abhiram.<br>
<br><br><div class="gmail_quote">On Sun, Dec 6, 2009 at 2:59 AM, Michael Pyne <span dir="ltr"><<a href="mailto:mpyne@purinchu.net">mpyne@purinchu.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Saturday 05 December 2009 15:25:13 Plasty Grove wrote:<br>
> That makes sense, but even the following doesn't work:<br>
><br>
> QString qstr = "/home/mydir/music/song.mp3";<br>
> QByteArray qbArray = qstr.toLocal8Bit();<br>
> const char* str = qbArray.constData();<br>
> TagLib::FileRef tagFile(str);<br>
><br>
> In this case, I've got a local object which stores the value returned by<br>
> toLocal8Bit() and which is in scope when I'm using str. Does qbArray get<br>
> destroyed whenever constData() is called on it? When I'm debugging, I can<br>
> still see str holding a value when it goes to the next step.<br>
<br>
</div>Perhaps an encoding issue if you don't use straight US-ASCII for your file<br>
names? In that case if "local8Bit" is not the encoding Taglib is expecting<br>
you'll get weirdness.<br>
<br>
The KDE JuK music manager uses taglib and has TString/QString conversion code<br>
(and I'm sure Amarok has the same thing) if you want to see how those projects<br>
do it.<br>
<br>
If it's not encoding I'm not sure what to try other than stepping through<br>
FileRef in the debugger to see where the logic goes astray.<br>
<br>
Regards,<br>
<font color="#888888"> - Michael Pyne<br>
</font><br>_______________________________________________<br>
taglib-devel mailing list<br>
<a href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/taglib-devel" target="_blank">https://mail.kde.org/mailman/listinfo/taglib-devel</a><br>
<br></blockquote></div><br>