Hi,<div><br></div><div>In reading some mp3 files (in particular one with Japanese characters in the filename), the following (Qt) code returns inconsistent results.</div><div><br></div><div>(filePath is a QString passed by const ref, f is a Taglib::File*)</div>
<div><br></div><div>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">QString</span><span style="color:rgb(192,192,192)"> </span>fileExt<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>filePath.right(filePath.length()<span style="color:rgb(192,192,192)"> </span>-<span style="color:rgb(192,192,192)"> </span>filePath.lastIndexOf(<span style="color:rgb(0,128,0)">"."</span>)<span style="color:rgb(192,192,192)"> </span>-<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">1</span>).toLower();<span style="color:rgb(192,192,192)">  </span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">const</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">char</span>*<span style="color:rgb(192,192,192)"> </span>filePathCh<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">QFile</span>::encodeName(filePath);</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800000">f</span><span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>NULL;</pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#808000">if</span>(fileExt<span style="color:#c0c0c0"> </span>==<span style="color:#c0c0c0"> </span><span style="color:#008000">"mp3"</span>){</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">  </span><span style="color:#800080">std</span>::cerr<span style="color:#c0c0c0"> </span><<<span style="color:#c0c0c0"> </span>filePathCh<span style="color:#c0c0c0"> </span><<<span style="color:#c0c0c0"> </span><span style="color:#800080">std</span>::endl;</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">  </span><span style="color:#800000">f</span><span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#808000">new</span><span style="color:#c0c0c0"> </span><span style="color:#800080">TagLib</span>::<span style="color:#800080">MPEG</span>::<span style="color:#800080">File</span>(filePathCh,<span style="color:#808000">false</span>);</pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">  </span><span style="color:#800080">std</span>::cerr<span style="color:#c0c0c0"> </span><<<span style="color:#c0c0c0"> </span>filePathCh<span style="color:#c0c0c0"> </span><<<span style="color:#c0c0c0"> </span><span style="color:#800080">std</span>::endl;</pre>

<pre style="margin-top:0px;margin-bottom:0px">}</pre><pre style="margin-top:0px;margin-bottom:0px"><div style="font-family:arial;white-space:normal"><br></div><div style="font-family:arial;white-space:normal">Sometimes, when passed the path of a file, this code works fine, returning a valid File object whose tags I can read and write; in these cases the two prints to cerr are correct (showing the whole file path) and identical. Other times, f is returned invalid, and while the first print to cerr is correct, the second is either blank or incomplete (usually with the beginning truncated). I cannot determine what causes the divergent behaviour.</div>
<div style="font-family:arial;white-space:normal"><br></div><div style="font-family:arial;white-space:normal">This is all using TagLib 1.7 and Qt 4.7.4, on Mac OS 10.7.2. Does anyone have any idea what might be causing this, or have you seen anything similar? Any help appreciated.</div>
<div style="font-family:arial;white-space:normal"><br></div><div style="font-family:arial;white-space:normal">Best regards</div><div style="font-family:arial;white-space:normal">Ibrahim</div></pre></div>