<div>Hi all once again,</div><div><br></div><div>I am using the Android &#39;Crystax&#39; R5 SDK to use TagLib on Android:</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.crystax.net/android/ndk.php">http://www.crystax.net/android/ndk.php</a></div>

<div><br></div><div>which is still having some issues with wstring / wchar support:</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.crystax.net/trac/ticket/26">http://www.crystax.net/trac/ticket/26</a></div>

<div><br></div><div><br></div><div>Now in TagLib, in the file tstring.cpp, the wstring::erase() method is used, which is NO problem ofcourse with native Linux/Windows development and I guess any other platform for now, but with Crystax it fails to properly move all characters of the resulting string. The workaround I found, for now, is this:</div>

<div><br></div><div>...</div><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">void String::prepare(Type t)</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">{</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">  switch(t) {</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">  case UTF16:</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">  {</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">    if(d-&gt;data.size() &gt;= 1 &amp;&amp; (d-&gt;data[0] == 0xfeff || d-&gt;data[0] == 0xfffe)) {</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">      bool swap = d-&gt;data[0] != 0xfeff;</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">      </font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">      // ORIGINAL TAGLIB CODE. ERASE FUNCTION RESPONSIBLE FOR DUPLICATE CHARACTER ON 6TH POSITION OF STRING USING CRYSTAX</font></div><div>

<font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">      //d-&gt;data.erase(d-&gt;data.begin(), d-&gt;data.begin() + 1);</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">      </font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">      // FIX FOR CRYSTAX R5 SDK:</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">      for(uint i =0; i &lt; d-&gt;data.size()-1; i++){</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>d-&gt;data[i] = d-&gt;data[i+1];</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">      }  </font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace" size="1">      d-&gt;data.resize(d-&gt;data.size()-1);</font></div></div><div>...</div><div><br></div><div>Note that I also could not use the &#39;wstring::copy()&#39; method either, it produces the same bug...</div>

<div><br></div><div>Is there perhaps a way to implement this &#39;workaround&#39; without having to change an internal class of TagLib, with which nothing is wrong? Because I wouldn&#39;t dare to ask to include this change in the official sourcecode, with precompiler directive or not, since it&#39;s not a bug of TagLib itself... or should I? ;)</div>

<div><br></div><div>Thanks for reading, hope to hear any thoughts,</div><div>  Martijn van Rheenen</div><br>