Converting between String^
and std::string is very easy using marshal_as. However, I have nowhere found a description of how encodings in such a string are handled. String^
uses UTF-16 but what about std::string? Text in that can be interpreted in various ways and it would be very usefull if the marshalling would convert to an encoding that is native to your application.
In my case all std::string
instances contain UTF-8 encoded text. So how would I tell marshal_as to give me an UTF-8 encoded variant of the original String^
(and vice versa)?