I know that there are already several questions on StackOverflow about std::string
versus std::wstring
or similar but none of them proposed a full solution.
In order to obtain a good answer I should define the requirements:
CFStringRef
, wchar_t *
, char*
as UTF-8 or other types as they are required by OS API. Remark: I don't need code-page convertion support because I expect to use only Unicode compatible functions on all operating systems supported.I would really appreciate only one proposed solution per answer, by doing this people may vote for their prefered alternative. If you have more than one alternative just add another answer.
Please indicate something that did worked for you.
Related questions:
Same as Adam Rosenfield answer (+1), but I use UTFCPP instead.