Thanks, I tried your code it works but it displays the following message when I run it: "\x{feff}" does not map to cp1256, <IN> line 1. And the character \x{feff} is displayed at the beginning of the file before the text in the output file, I don't know why?