Identify if text file is ascii or unicode

J

Jack Russell

Is there an attribute that I can test to tell whether a file is saved as
ascii, unicode etc?

Thanks

Jack Russell
 
J

Jack Russell

m.posseth said:
well you need to read the BOM ( Byte Order Mark )

but the streamreader has an option that will read this for you when getting
the data

Dim sr As New StreamReader("c:\aFileWithUnknownEncoding.txt", True) ' the
true flag stands for detect encoding by BOM

not VB but might be of some usage to you

http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=469

regards

Michel Posseth [MCP]






Is there an attribute that I can test to tell whether a file is saved as
ascii, unicode etc?

Thanks

Jack Russell
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top