Hi Harshdip,
I don't remember exactly for TC8.20, but for TC8.70 and up you can set encoding for the script units via Character Encoding property of the project (
http://support.smartbear.com/viewarticle/30056/).To determine the encoding during run-time, you can either use the aqFile.OpenBinaryFile() method (
http://support.smartbear.com/viewarticle/27841/) and read the first several bytes of the file to determine its encoding type, or to use the code like this (which, basically, does the same but using native OS means; JScript):
function isUnicode(fileName)
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var aFile = fso.OpenTextFile(fileName, 1, false, 0);
var flag = aFile.Read(2)
aFile.Close();
var template = String.fromCharCode(1103, 1102);
if (flag == template) return true;
return false;
}