if(data && data.length&&typeof data != "string"){
data = data[0];
}if(!data ||typeof data != "string"){return data;
}// certain XMLish characters break Flash's wire serialization for// ExternalInterface; these are encoded on the // DojoExternalInterface side into a custom encoding, rather than// the standard entity encoding, because otherwise we won't be able to// differentiate between our own encoding and any entity characters// that are being used in the string itself
data = data.replace(/\&custom_lt\;/g, "<");
data = data.replace(/\&custom_gt\;/g, ">");
data = data.replace(/\&custom_backslash\;/g, '\\');
// needed for IE; \0 is the NULL character
data = data.replace(/\\0/g|>, "\0");
return data;