Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If your file data is not UTF-16 encoded, but your Edit window is using UTF-16 (because it was registered with <code>RegisterClassW()</code> or <code>RegisterClassExW()</code>), then you must either:</p> <ol> <li><p>convert the file data to UTF-16 yourself using <code>MultiByteToWideChar()</code> (or equivalent) and then use <code>SendMessageW()</code> to send <code>WM_SETTEXT</code>.</p></li> <li><p>use <code>SendMessageA()</code> to send <code>WM_SETTEXT</code> and let the OS convert the data to UTF-16 for you using the OS's default Ansi codepage (this only works if the file data matches the OS's default encoding).</p></li> </ol> <p>If your file data is UTF-16 encoded, but your Edit window is not using UTF-16 (because it was registered with <code>RegisterClassA()</code> or <code>RegisterclassExA()</code>), then you must either:</p> <ol> <li><p>convert the file data to Ansi yourself using <code>WideCharToMultiByte()</code> (or equivalent) and then use <code>SendMessageA()</code> to send <code>WM_SETTEXT</code>.</p></li> <li><p>use <code>SendMessageW()</code> to send <code>WM_SETTEXT</code> and let the OS convert the data to Ansi for you using the OS's default Ansi codepage.</p></li> </ol> <p>If your file data is UTF-16 encoded and your Edit window is using UTF-16, or if your file data is Ansi encoded and your Edit window is using Ansi and the encodings match, then you can use the generic <code>SendMessage()</code> to send <code>WM_SETTEXT</code> passing the data as-is without needing to do any conversions.</p> <p>You can use <code>IsWindowUnicode()</code> to know whether the Edit window is using Ansi or UTF-16. As for the file data, you could try using <code>IsTextUnicode()</code>, but that is known to report false results, so you really should not rely on it. Know what your file encoding is ahead of time and code for that, or else prompt the user for the file encoding.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload