cancel
Showing results for 
Search instead for 
Did you mean: 

aqFile.WriteToTextFile inserts 3 chars at begining

New Contributor

aqFile.WriteToTextFile inserts 3 chars at begining

Hi,

I have this simple code in JScript:

  aqFile.WriteToTextFile("c:\\tmp.txt","text",aqFile.ctUTF8);

and the result is attached. I guess it is a bug or am I missing something?



Regards

David
3 REPLIES 3
Community Hero

RE: aqFile.WriteToTextFile inserts 3 chars at begining

Hi David,



These three bytes are a signature (http://en.wikipedia.org/wiki/Byte_order_mark) that the file is in Unicode format (as specified in your code). So the behaviour seems to be correct.
Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
New Contributor

RE: aqFile.WriteToTextFile inserts 3 chars at begining

Oops. I must look dumb now Smiley Wink However, our application does not write BOM into UTF-8 files (since it is not mandatory) and thus when I compare such two files, these 3 chars are extra. I suppose there is no way how to tell TC not to write these 3 bytes, is it?
Community Hero

RE: aqFile.WriteToTextFile inserts 3 chars at begining

Hi David,



Try

aqFile.WriteToTextFile("c:\\tmp.txt","text",aqFile.ctANSI);
Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors