nem
14 years agoOccasional Contributor
Unable to read file containing unicode characters line by line
Hello,
I work with TC 8.1.
I’m getting strange behavior when trying to read a text file containing Unicode characters e.g. hieroglyphs or umlauts. The file is converted to UTF8 format.
It works okay and I receive expected data if I try to read whole file:
var oFile=aqFileSystem.GetFileInfo("file.txt");
oFile = oFile.ReadWholeTextFile(aqFile.ctUTF8);
Log.Message(oFile);
But it returns question marks (????) if I try to read the same file line by line:
var oFile = aqFileSystem.GetFileInfo("file.txt");
oFile = oFile.OpenTextFile(aqFile.faRead, aqFile.ctUTF8);
while(!oFile.IsEndOfFile()){
Log.Message(oFile.ReadLine());
}
The file I try to read is attached in archive.
Could someone please help to resolve the issue?
Thanks
I work with TC 8.1.
I’m getting strange behavior when trying to read a text file containing Unicode characters e.g. hieroglyphs or umlauts. The file is converted to UTF8 format.
It works okay and I receive expected data if I try to read whole file:
var oFile=aqFileSystem.GetFileInfo("file.txt");
oFile = oFile.ReadWholeTextFile(aqFile.ctUTF8);
Log.Message(oFile);
But it returns question marks (????) if I try to read the same file line by line:
var oFile = aqFileSystem.GetFileInfo("file.txt");
oFile = oFile.OpenTextFile(aqFile.faRead, aqFile.ctUTF8);
while(!oFile.IsEndOfFile()){
Log.Message(oFile.ReadLine());
}
The file I try to read is attached in archive.
Could someone please help to resolve the issue?
Thanks