wstring(char *Text) constructor ?? or how to handle ?
Posted on 2001-08-26
I'm thinking about using wstring as basis (base clase) for my 'own' string class with extra functionality for my project.
The reasoning behind it is that I get text input in different ways. Some of it is SBCS, some of it is MBCS and some of it is Unicode.
Still doubting about the best approach but I guess storing everything as Unicode seems a good idea ... ??
While doing so (playing with the concept) I noticed that wstring doesn't 'know' char* as input.
So ... I guess I need to call a Windows routine to convert to Unicode ... is this so ? Any idea which one ?
Does that then also apply to e.g. :
MyString TestStr("This is a test") ;
I mean ... Do I need to convert all text I type-in in my project ?
Or will e.g. MyString TestStr((wchar_t*)"This is a test") ; work ??