UTF8toWCHAR has a constructor that accepts a UTF8 character pointer "char *", and an implicit type casting operator to cast to "const wchar_t *". Thus it can be used like a function that accepts a UTF8 string as input and returns a wide string as output. Note that the memory required for the output is from the UTF8toWCHAR object, so it must be used before the object is destroyed.
A typical usage is like:
functionRequiringWideString(UTF8toWCHAR(a_utf8_string));
In the above, the UTF8toWCHAR object is destroyed after the function returns, so the converted wide string is valid for the lifetime of the function call.
Method | Inherited | Description |
---|---|---|
UTF8toWCHAR | (Self) | Constructs a UTF8toWCHAR object. |
const_wchar_t_ptr | (Self) | Operator for implicit casting to const wchar_t *. |