How do I get a consistent byte representation of strings in C# without manually specifying an encoding?
Contrary to the answers here, you DON’T need to worry about encoding if the bytes don’t need to be interpreted! Like you mentioned, your goal is, simply, to “get what bytes the string has been stored in”. (And, of course, to be able to re-construct the string from the bytes.) For those goals, I honestly … Read more