title: What is the difference between Delphi string comparsion functions?
body: <p>There's a bunch of ways you can compare strings in modern Delphi (say 2010-XE3):</p>
  
  <ul>
  <li>'&lt;=' operator which resolves to UStrCmp / LStrCmp</li>
  <li>CompareStr</li>
  <li>AnsiCompareStr</li>
  </ul>
  
  <p><strong>Can someone give (or point to) a description of what those methods do, in principle?</strong></p>
  
  <p>So far I've figured that AnsiCompareStr calls CompareString on Windows, which is a "textual" comparison (i.e. takes into account unicode combined characters etc). Simple CompareStr does not do that and seems to do a binary comparison instead.</p>
  
  <p>But what is the difference between CompareStr and UStrCmp? Between UStrCmp and LStrCmp? Do they all produce identical results? Do those results change between versions of Delphi?</p>
  
  <p>I'm asking because I need a comparison which will always produce the same results, so that indexes in app built with one version of Delphi remain consistent with code built with another.</p>