function checkEncode(str : String) : String
{
if(!str) return "";
var oriByteArr : ByteArray=new ByteArray();
oriByteArr.writeUTFBytes(str);
oriByteArr.position=0;
var b0 : int = oriByteArr.readUnsignedByte();
var b1 : int = oriByteArr.readUnsignedByte();
var fileType : String = "default";
if(b0 == 0xFF && b1 == 0xFE) {
fileType = "Unicode";
}else if(b0 == 0xFE && b1 == 0xFF) {
fileType = "Unicode big endian";
}else if(b0 == 0xEF && b1 == 0xBB) {
fileType = "UTF-8";
}else if(b0==0x5B&&b1==0x74){
fileType = "ANSI";
}
return fileType;
}