At the moment, D does not have extensive native facilities for converting text between encodings.
Here are some options:
- As ratchet freak mentioned, D does have std.encoding, but it does not cover many encodings at the moment.
- On Windows, you could use
std.windows.charset.fromMBSz
andtoMBSz
, which wrapMultiByteToWideChar
andWideCharToMultiByte
. - You could simply embed the encodings that interest you in your program (example).
- On POSIX, you could invoke the
iconv
program (example), or use thelibiconv
library (D1 binding).