I have a bunch of strings in my program. I don't know how these strings are encoded, or what determines the encoding. Everything I read about this in c++ seems to simply state that char and string are encoding agnostic and don't care about what you shove into them. However, it would be very useful to me to know this.
When I write std::string = "some text"
if this is a utf8/16/32, ascii, extended ascii, or other encoding scheme that gets utilized. Is this determined by the compiler? Or the target OS? The target hardware?
What factors are at play in the implementation that determines how the string gets encoded, and how can I detect them?
Does the encoding of the source file matter? If all my source files are utf8, can I guarantee that gcc/g++ will always encode strings as utf8?