<div dir="ltr"><div><div>I had similar issue when use fpc 2.7.1 r25610. I have application on linux with cwstring manager, but same error was aswell on windows. When I used ANSICompareStr and as parameters sent 2 unicode strings, result was always 0. What I observed - because parameters of ANSICompareStr are ansi strings, 2 calls of fpc_UnicodeStr_To_AnsiStr was made before enter into ANSICompareStr. In first call was Result of fpc_UnicodeStr_To_AnsiStr on begin nil - OK. But in second call was Result of fpc_UnicodeStr_To_AnsiStr on begin not nil - which is not OK and caused free of previously translated string and create second string on its place. Because of this, ANSICompareStr both parameters pointed to one memory location and so result of ANSICompareStr was always 0.<br>
</div>In fpc 2.7.1 r25725 this problem exists never more.<br><br></div>tomas<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 9, 2013 at 8:51 PM, Martin <span dir="ltr"><<a href="mailto:lazarus@mfriebe.de" target="_blank">lazarus@mfriebe.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It seems for some people using 2.7.1<br>
FCurrentString: string;<br>
<br>
if 0 = WideCompareText(UTF8Decode(<u></u>fCurrentString),<br>
UTF8Decode(Copy(ItemList[i], 1, Length(fCurrentString))))<br>
<br>
does not compare correct.<br>
<a href="http://bugs.freepascal.org/view.php?id=25156" target="_blank">http://bugs.freepascal.org/<u></u>view.php?id=25156</a><br>
<br>
<br>
How can they best check if this is:<br>
- an issue with their setup, maybe widestringmanager failing.<br>
- an issue with UTF8Decode<br>
-- maybe because the encoding of FCurrentString?<br>
<br>
Though I wonder which encoding FCurrentString could have an their system, to fail latin a-z letters from being correctly converted?<br>
<br>
<br>
______________________________<u></u>_________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/<u></u>mailman/listinfo/fpc-devel</a><br>
</blockquote></div><br></div>