Allocate a char string with cs_malloc() and copy the string into the newly allocated storage.

This is a handy method for copying strings, in fact it is an analogue of the strdup() function from string.h, but using cs_malloc(). (Also, strdup() is not present on some platforms). To free the pointer the caller should call cs_free().

wchar_t* CS::StrDupW

(

const char *

s

)

Allocate a wide char string with cs_malloc() and copy the string converted from UTF-8 into the newly allocated storage.