Rename std.string.toStringz?

Jonathan M Davis jmdavisProg at gmx.com
Fri Jun 17 08:28:09 PDT 2011


On 2011-06-17 06:21, Kagamin wrote:
> Daniel Gibson Wrote:
> >   char* to!c_str(string s) (or immutable(char)* or something)
> > 
> > i.e. the related toImpl looks like
> > 
> >   char* toImpl(c_str, string)(string s)
> > 
> > => 3 types! (char*, c_str, string)
> 
> btw, if we're talking about C api, the return type must not be char*,
> because c string character encoding is not utf-8, but char* implies utf-8.

The C string encoding that the system expects depends on your locale and the 
function that you're calling. For the most part, it _is_ UTF-8 - at least on 
Linux.

- Jonathan M Davis


More information about the Digitalmars-d mailing list