Identify if text file is ascii or unicode

  • Thread starter Thread starter Jack Russell
  • Start date Start date
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
 
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
 
Back
Top