Re: to read a textfile regarding his format

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



with the boolean in the constructor of the streamreader you can set it to
automaticly detect the Byte Order Mark

regards

Michel Posseth



"andreas" <andreas@xxxxxxxxxx> schreef in bericht
news:6Zn9g.422959$PO.11297938@xxxxxxxxxxxxxxxxxxxxxxxx
A textfile can have different formats like ANSI,UTF8, Unicode ...
Using streamreader for a textfile can have different results for chars
like
é,à,è....depending of the fileformat.
To solve this problem I have in the code analysed the chars in the
beginning
of the textfile, named the BOM to see the system.text.encoding for using
this information in the streamreader.
But my question is :
Is there a way that vb.net can do this automatically?
Thanks for any response




.



Relevant Pages

  • good reading a textfile
    ... A textfile can have different formats like ANSI,UTF8, Unicode ... ... Using streamreader for a textfile can have different results for chars like ... To solve this problem I have in the code analysed the chars in the beginning ...
    (comp.lang.basic.visual.misc)
  • to read a textfile regarding his format
    ... A textfile can have different formats like ANSI,UTF8, Unicode ... ... Using streamreader for a textfile can have different results for chars like ... To solve this problem I have in the code analysed the chars in the beginning ...
    (microsoft.public.dotnet.languages.vb)
  • Re: to read a textfile regarding his format
    ... but the sr didn't recognise a ANSI file made with notepad ... Using streamreader for a textfile can have different results for chars ...
    (microsoft.public.dotnet.languages.vb)
  • =?utf-8?B?UmU6IFdhbnQgdG8gcmVwbGFjZSB0aGUgc3BlY2lhbCBjaGFyICjigKIpIHdoaWxlIHIgIGVhZGluZyB4bWwgYn
    ... i have used streamreader and saved the file locally then replace special ... chars, and then manipulate the file, it takes time but my job is done with ... way you should be able to consume megabytes as usual with XmlReader. ...
    (microsoft.public.dotnet.xml)
  • How to display non-english chars in textbox?
    ... When i load a text document using streamReader into my textbox with ... chars are not displayed. ...
    (microsoft.public.dotnet.languages.vb)