Doesnt have to. It has a local variable UTF8String which is of type AnsiString(CP_UTF8), then its assigned to the result of type RawByteString and the CP is preserved.
You're right, I missed that variable. I thought it was updating the Result directly.