convert ANSI to UTF-8

Sean Kelly sean at f4.ca
Fri Jul 7 08:25:47 PDT 2006


gertje at gertje.org wrote:
> Hello,
> 
> Does anybody have or know how to write a function to convert an ANSI string to a
> UTF-8 string? I am not using windows, so I cannot rely on the functions in
> std.windows.charset, since they use the MultiByteToWideChar function from the
> windows API...

You might want to look at 'mbsrtowcs' which is a standard C function. 
It's supposed to be in wchar.h, but as wchar is a keyword in D I've 
placed it in string.d instead:

http://svn.dsource.org/projects/ares/trunk/src/ares/std/c/string.d


Sean



More information about the Digitalmars-d mailing list