The following does not work import std.conv; import std.encoding; string s = "hello world"; AsciiString t = to!(AsciiString)(s); However, it is perfectly possible to do the transoding by using std.encoding functions alone. import std.encoding; string s = "hello world"; AsciiString t; transcode(s,t); Please fix std.conv.to so that it recognises AsciiString, Latin1String and Windows1252String, and can transcode between all string types.
Invalidated by the upcoming demise of std.encoding.