<div dir="ltr">You should open an issue on <a href="https://issues.dlang.org/">https://issues.dlang.org/</a><div><br></div><div>until it is fixed you can use lazy variation byChar, byWchar or byUTF:</div><div><br></div><div><span style="font-size:12.8px">void main()</span><br style="font-size:12.8px"><span style="font-size:12.8px">{</span></div><div><br style="font-size:12.8px"><span style="font-size:12.8px"> import std.utf : byWchar;</span></div><div> import std.array : array;<br style="font-size:12.8px"><span style="font-size:12.8px"> </span><br style="font-size:12.8px"><span style="font-size:12.8px"> wstring s = byWchar("abc").array;</span><br style="font-size:12.8px"><span style="font-size:12.8px">}</span><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 16, 2017 at 7:09 AM, apz28 via Digitalmars-d-learn <span dir="ltr"><<a href="mailto:digitalmars-d-learn@puremagic.com" target="_blank">digitalmars-d-learn@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">void main()<br>
{<br>
import std.utf : toUTF16; // Same problem with toUTF8<br>
<br>
wstring s = toUTF16!string("abc");<br>
}<br>
<br>
Compilation output:<br>
/d500/f513.d(3): Deprecation: function std.utf.toUTF16 is deprecated - To be removed November 2017. Please use std.utf.encode instead.<br>
/d500/f513.d(3): Deprecation: function std.utf.toUTF16 is deprecated - To be removed November 2017. Please use std.utf.encode instead.<br>
<br>
</blockquote></div><br></div>