title: How to get the size of a UTF-16LE string in bytes?
body: <p>Say I have the following:</p>
  
  <pre><code>wchar_t *str = L"Hello World!";
  </code></pre>
  
  <p>I want to get the size of <code>L"Hello World!"</code> in bytes (not how many characters it consists of).</p>
  
  <p>I have read that <code>wcslen()</code> counts every 2 bytes as 1 character, so if a character is 4 bytes, it will treat it as 2 characters!</p>
  
  <p>This is great for me because now I can just do:</p>
  
  <pre><code>int size_of_str_in_bytes = wcslen(str) * 2;
  </code></pre>
  
  <p>But is it guaranteed that <code>wcslen()</code> will always behave this way?</p>