Forum Discussion

nem's avatar
nem
Occasional Contributor
14 years ago

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

3 Replies


  • Hello,





    We have reproduced the behavior and are investigating it. We will let you know as soon as we have results.
  • nem's avatar
    nem
    Occasional Contributor
    Thanks!

    BTW I have reproduced it with TC 8.2 as well.

  • Hi,





    Thank you for reporting the problem. It should be fixed in the next TestComplete update.





    Meanwhile, you can try using the alternative approaches cited in the Reading Text Files help topic.