Set encoded contents to empty string, warn on null bytes.