varadarajanramchander wrote:Why would it? Since most strings are not created from a series of bytes, most of the time that method would be returning null. And if you concatenated two strings, what should the "sourceEncoding" property of the result be? No, the idea really doesn't make any sense at all.
Why does a String not have a method to find the encoding with which the string was originally created? I want to know if the encoding matches what I want and if not, throw an exception. Why does such a method not exist?