[OP, via e-mail]
i have text file only which i want to convert in specified format
will this Encoding.Unicode and Encoding.BigEndianUnicode do the job .?
Yes, assuming that your specified format is UTF-16. It should work
with any other available encoding that you care to name. For
reasonable-length files you can probably even get awasy with simply:
string contents = File.ReadAllText(path,
Encoding.Unicode);
File.WriteAllText(path, contents,
Encoding.BigEndianUnicode);
(and even the first line might be considered overkill, as it will
*usually* guess the incoming encoding)
Marc