[prev in list] [next in list] [prev in thread] [next in thread] 

List:       taglib-devel
Subject:    Re: Creating FileRef object from QString
From:       Michael Pyne <mpyne () purinchu ! net>
Date:       2009-12-06 7:30:27
Message-ID: 200912060230.33606.mpyne () purinchu ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Saturday 05 December 2009 23:56:58 Plasty Grove wrote:
> Thanks so much Michael. That's exactly what was needed, straight ASCII
> conversion.
> 
> This is what works:
> 
> QString qstr = "/home/mydir/music/song.mp3";
> TagLib::FileRef tagFile(qstr.toAscii());
> 
> Apologies, I didn't take note of the toAscii() function.

Please keep in mind that this is still broken in like 92% of the world or so. 
You will in general need to use /some/ encoding, you just need to make sure 
TagLib is using the same one.

I'd recommend UTF8 as it's supported by both TagLib and Qt.

Indeed, I finally took a look at the TagLib String API reference 
(http://developer.kde.org/~wheeler/taglib/api/classTagLib_1_1String.html) and 
noted that the function you want is already defined:

QStringToTString(s) (in the Related Functions section).

So don't reinvent the wheel, just use QStringToTString

Regards,
 - Michael Pyne

["signature.asc" (application/pgp-signature)]

_______________________________________________
taglib-devel mailing list
taglib-devel@kde.org
https://mail.kde.org/mailman/listinfo/taglib-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic