<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>I use this in my app:</p>
<p><br>
</p>
<p>#ifdef Q_OS_WIN32<br>
TagLib::FileRef fileRef(reinterpret_cast<const wchar_t
*>(fileName.utf16()), true);<br>
//TagLib::FileRef fileRef(reinterpret_cast<const wchar_t
*>("c:/Qt/projects/Audio_tests/test.mp3"), true);<br>
//qDebug() << reinterpret_cast<const wchar_t
*>(fileName.utf16()); // << fileName;<br>
#else<br>
QByteArray encodedFileName = QFile::encodeName(fileName);<br>
TagLib::FileRef fileRef(encodedFileName.constData(), true);<br>
#endif<br>
</p>
<p>You could try it...</p>
<p><br>
</p>
<p>Best regards,</p>
<p>Vladimir</p>
<br>
<div class="moz-cite-prefix">Dne 16.8.2016 v 23:00 Ossigeno
napsal(a):<br>
</div>
<blockquote
cite="mid:ad61f50dd07de972e5ce47590e4f6d11@wm10.email.it"
type="cite">
<div><span style="font-size: small;">Tried this</span></div>
<divre style="margin: 0px;">
<div> </div>
<divre style="margin: 0px;"><span style="font-size: small;"><span
style="color: #800080;">QByteArray</span>myTaggger=<span
style="color: #808000;">new</span><span style="color:
#800080;">TagLib</span>::<span style="color: #800080;">FileRef</span>(tmp.toLocal8Bit());</span><br>
<br>
<span style="font-size: small;">Qt Creator returns this error:</span><br>
<br>
<span style="font-size: small;">error: conversion from
'QByteArray' to 'TagLib::File*' is ambiguous QByteArray
myTaggger = new TagLib::FileRef(tmp.toLocal8Bit());</span> ^
<blockquote style="padding-right: 0px; padding-left: 5px;
margin-left: 5px; border-left: #000000 2px solid;
margin-right: 0px;" dir="ltr">
<div style="font: 10pt arial;">--------- Original Message
--------<br>
Da: <a class="moz-txt-link-abbreviated" href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</a><br>
To: <a class="moz-txt-link-rfc2396E" href="mailto:taglib-devel@kde.org">"taglib-devel@kde.org"</a> <a class="moz-txt-link-rfc2396E" href="mailto:taglib-devel@kde.org"><taglib-devel@kde.org></a><br>
Oggetto: Re: Qt/TagLib special chatacter<br>
Data: 15/08/16 03:25<br>
<br>
<!-- begin tln_sanitized html -->
<div>Hi,</div>
<div>In my own application, I used : </div>
<div>filename->toLocal8Bit()</div>
<div>such as : myTaggger = new
TagLib::FileRef(filename->toLocal8Bit());</div>
<div>Hope, it helps.</div>
<div> </div>
<div>Renaud G.<br>
</div>
<div class="moz-cite-prefix">On 15/08/2016 01:53, Marco
Atzori wrote:</div>
<blockquote
cite="mid:49581060-208a-3f3f-ddf7-9c63d3b2407d@gmail.com"><span
style="color: #242729;">I have a this filename: "??
Feels So Good (sonique Best Remix Extended Version)
Music Song Video ? love romantic "<br>
<br>
</span><span style="color: #242729;">Usually, to extract
the file information I use this code<br>
<br>
</span>
<divre class="default prettyprint prettyprinted"
style="margin: 0px 0px 1em; padding: 5px; border: 0px;
font-size: 13px; width: auto; max-height: 600px;
overflow: auto; font-family: Consolas, Menlo,
Monaco,;"><code style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; font-family: Consolas,
Menlo, Monaco,;"><span class="typ" style="margin:
0px; padding: 0px; border: 0px; font-size: 13px;
color: #2b91af;"> QString</span><span class="pln"
style="margin: 0px; padding: 0px; border: 0px;
font-size: 13px; color: #303336;"> mediafile </span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">=</span><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">
playlist</span><span class="pun" style="margin:
0px; padding: 0px; border: 0px; font-size: 13px;
color: #303336;">-></span><span class="pln"
style="margin: 0px; padding: 0px; border: 0px;
font-size: 13px; color:
#303336;">currentMedia</span><span class="pun"
style="margin: 0px; padding: 0px; border: 0px;
font-size: 13px; color: #303336;">().</span><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">canonicalUrl</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">().</span><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">toString</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">();</span><span
class="typ" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #2b91af;">TagLib</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">::</span><span
class="typ" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #2b91af;">FileRef</span><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size:
13px; color: #303336;"> f</span><span class="pun"
style="margin: 0px; padding: 0px; border: 0px;
font-size: 13px; color: #303336;">(</span><span
class="typ" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #2b91af;">QFile</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">::</span><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">encodeName</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">(</span><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">mediafile</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">).</span><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">constData</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size:
13px; color: #303336;">());
</span></code>
<br>
<em style="margin: 0px; padding: 0px; border: 0px;
font-size: 15px; font-style: italic; color:
#242729;">This code works perfectly</em><span
style="color: #242729;">, only does not work when
the file name contains special characters as above.
I tried<br>
<br>
</span>
<divre class="default prettyprint prettyprinted"
style="margin: 0px 0px 1em; padding: 5px; border:
0px; font-size: 13px; width: auto; max-height:
600px; overflow: auto; font-family: Consolas, Menlo,
Monaco,;"><code style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; font-family:
Consolas, Menlo, Monaco,;"><span class="typ"
style="margin: 0px; padding: 0px; border: 0px;
font-size: 13px; color: #2b91af;">QTextCodec</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">*</span><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">codec
</span><span class="pun" style="margin: 0px;
padding: 0px; border: 0px; font-size: 13px;
color: #303336;">=</span><span class="typ"
style="margin: 0px; padding: 0px; border: 0px;
font-size: 13px; color: #2b91af;">QTextCodec</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">::</span><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">codecForName</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">(</span><span
class="str" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #7d2727;">"UTF-8"</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">);
</span></code>
and<br>
<br>
<divre class="default prettyprint prettyprinted"
style="margin: 0px 0px 1em; padding: 5px; border:
0px; font-size: 13px; width: auto; max-height:
600px; overflow: auto; font-family: Consolas,
Menlo, Monaco,;"><code style="margin: 0px;
padding: 0px; border: 0px; font-size: 13px;
font-family: Consolas, Menlo, Monaco,;"><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">mediafile</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">.</span><span
class="pln" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">toUtf8</span><span
class="pun" style="margin: 0px; padding: 0px;
border: 0px; font-size: 13px; color: #303336;">()</span></code>
<span style="color: #242729;">with no results. Any
solution?</span></divre></divre></divre></blockquote>
<br>
<!-- end tln_sanitized html --></div>
</blockquote>
<br>
<div><font face="Verdana,Arial" size="2">----<br>
ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio
email.it, per tutti i dettagli <a moz-do-not-send="true"
href="http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer"
target="_blank">clicca qui</a><br>
<br>
Sponsor:<br>
Idee regalo classiche o alternative? Trova l'offerta
migliore in un click<br>
<a moz-do-not-send="true"
href="http://adv.email.it/cgi-bin/foclick.cgi?mid=13327&d=20160816"
target="_blank">Clicca qui</a> </font><br>
</div>
</divre></divre></blockquote>
<br>
</body>
</html>