Currently it returns const(wchar*) which renders the pointer to be unnassignable anymore: auto p = toUTF16z("test"); p = null; // variable p cannot modify const The same goes to toMBSz, which returns const(char*) instead of const(char)*
http://www.dsource.org/projects/phobos/changeset/1640 toMBSz() was fixed three years ago: http://www.dsource.org/projects/phobos/changeset/402/trunk/phobos/std/windows/charset.d
Fixed DMD 2.048