title: utf8decode in delphi 7
body: <p>I need to use delphi 7 to convert strings from utf8 to widestring. Could anybody tell me why the following code doesn't work in delphi 7? The parameter of the Utf8Decode function is just a sample.</p>
  
  <pre><code>var ws: WideString;
  begin
     ws := Utf8Decode('[ŘŁŮ…Ř¨ŮŠŘ±] Ř®Ř·ŘŁ ŘŞŮŠŘ§Ř±- ŘŞŮŠŘ§Ř± Ů…ŘŞŮŘ§ŘµŮ„ Ů…Ř·Ů„Ů‚');
  end;
  </code></pre>
  
  <p>In delphi 7 it gives me lot's of question marks,however in bds2006 it works well.</p>
  
  <p>Do I need to switch some compiler directive on, or how can I convert an utf8String to Widestring in delphi 7?</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>There's nothing wrong with the Utf8Decode function, The Delphi Code Insight Tooltip expression evaluation output misled me, which can't display Widestrings. see the image below:</p>
  
  <p><img src="https://i.stack.imgur.com/k0TWf.png" alt="Tooltip expression evaluation"></p>
  
  <p>but the MessageBoxW could display the text:</p>
  
  <p><img src="https://i.stack.imgur.com/oZDFX.png" alt="enter image description here"></p>